Skip to content

Commit c1008fb

Browse files
authored
chore: bump biome formatter to next major & reformat (#4145)
1 parent 5557f98 commit c1008fb

File tree

321 files changed

+966
-1080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+966
-1080
lines changed

.github/scripts/constants.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
module.exports = Object.freeze({
22
/** @type {string} */
33
// Values: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
4-
"PR_ACTION": process.env.PR_ACTION?.replace(/"/g, '') || "",
4+
PR_ACTION: process.env.PR_ACTION?.replace(/"/g, '') || '',
55

66
/** @type {string} */
7-
"PR_AUTHOR": process.env.PR_AUTHOR?.replace(/"/g, '') || "",
7+
PR_AUTHOR: process.env.PR_AUTHOR?.replace(/"/g, '') || '',
88

99
/** @type {string} */
10-
"PR_BODY": process.env.PR_BODY || "",
10+
PR_BODY: process.env.PR_BODY || '',
1111

1212
/** @type {string} */
13-
"PR_TITLE": process.env.PR_TITLE || "",
13+
PR_TITLE: process.env.PR_TITLE || '',
1414

1515
/** @type {number} */
16-
"PR_NUMBER": process.env.PR_NUMBER || 0,
16+
PR_NUMBER: process.env.PR_NUMBER || 0,
1717

1818
/** @type {string} */
19-
"PR_IS_MERGED": process.env.PR_IS_MERGED || "false",
19+
PR_IS_MERGED: process.env.PR_IS_MERGED || 'false',
2020

2121
/** @type {string} */
22-
"LABEL_BLOCK": "do-not-merge",
22+
LABEL_BLOCK: 'do-not-merge',
2323

2424
/** @type {string} */
25-
"LABEL_BLOCK_REASON": "need-issue",
25+
LABEL_BLOCK_REASON: 'need-issue',
2626

2727
/** @type {string} */
28-
"LABEL_PENDING_RELEASE": "pending-release",
29-
28+
LABEL_PENDING_RELEASE: 'pending-release',
29+
3030
/** @type {string} */
31-
"LABEL_RELEASED": "completed",
31+
LABEL_RELEASED: 'completed',
3232

3333
/** @type {string} */
34-
"HANDLE_MAINTAINERS_TEAM": "@aws-powertools/lambda-typescript",
34+
HANDLE_MAINTAINERS_TEAM: '@aws-powertools/lambda-typescript',
3535

3636
/** @type {string[]} */
37-
"IGNORE_AUTHORS": ["dependabot[bot]"],
37+
IGNORE_AUTHORS: ['dependabot[bot]'],
3838

3939
/** @type {RegExp} */
40-
"RELATED_ISSUE_REGEX": /\b\*{0,2}[iI]ssue [nN]umber\*{0,2}:\*{0,2}\s*(?<closingWord>closes?|closed|fix|fixes?|fixed|resolves?|resolved)?\s*#(?<issue>\d+)\b/
41-
});
40+
RELATED_ISSUE_REGEX:
41+
/\b\*{0,2}[iI]ssue [nN]umber\*{0,2}:\*{0,2}\s*(?<closingWord>closes?|closed|fix|fixes?|fixed|resolves?|resolved)?\s*#(?<issue>\d+)\b/,
42+
});
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module.exports = async ({github, context, core}) => {
2-
const fs = require('fs');
1+
const fs = require('node:fs');
32

3+
module.exports = async ({ github, context, core }) => {
44
const workflowRunId = process.env.WORKFLOW_ID;
55
core.info(`Listing artifacts for workflow run ${workflowRunId}`);
66

@@ -10,7 +10,9 @@ module.exports = async ({github, context, core}) => {
1010
run_id: workflowRunId,
1111
});
1212

13-
const matchArtifact = artifacts.data.artifacts.filter(artifact => artifact.name == "pr")[0];
13+
const matchArtifact = artifacts.data.artifacts.filter(
14+
(artifact) => artifact.name === 'pr'
15+
)[0];
1416

1517
core.info(`Downloading artifacts for workflow run ${workflowRunId}`);
1618
const artifact = await github.rest.actions.downloadArtifact({
@@ -20,7 +22,7 @@ module.exports = async ({github, context, core}) => {
2022
archive_format: 'zip',
2123
});
2224

23-
core.info("Saving artifact found", artifact);
25+
core.info('Saving artifact found', artifact);
2426

2527
fs.writeFileSync('pr.zip', Buffer.from(artifact.data));
26-
}
28+
};

.github/scripts/label_pr_based_on_title.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ module.exports = async ({ github, context, core }) => {
3030
});
3131

3232
return;
33-
} else {
34-
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);
35-
miss += 1;
3633
}
34+
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);
35+
miss += 1;
3736
}
3837
} finally {
39-
if (miss == Object.keys(labels).length) {
38+
if (miss === Object.keys(labels).length) {
4039
core.notice(
4140
`PR ${PR_NUMBER} title '${PR_TITLE}' contain any of the release-related types; skipping...`
4241
);

.github/scripts/label_related_issue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = async ({ github, context, core }) => {
1515
return core.notice('Author in IGNORE_AUTHORS list; skipping...');
1616
}
1717

18-
if (PR_IS_MERGED == 'false') {
18+
if (PR_IS_MERGED === 'false') {
1919
return core.notice('Only merged PRs to avoid spam; skipping');
2020
}
2121

.github/scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"type": "commonjs"
3-
}
3+
}

.github/scripts/post_release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const fetchIssues = async ({
2828
});
2929

3030
return issues.filter(
31-
(issue) => Object(issue).hasOwnProperty('pull_request') === false
31+
(issue) => Object.hasOwn(Object(issue), 'pull_request') === false
3232
);
3333
} catch (error) {
3434
core.setFailed(error);
@@ -84,7 +84,7 @@ const notifyRelease = async ({
8484

8585
// Remove staged label; keep existing ones
8686
const labels = issue.labels
87-
.filter((label) => label.name != LABEL_PENDING_RELEASE)
87+
.filter((label) => label.name !== LABEL_PENDING_RELEASE)
8888
.map((label) => label.name);
8989

9090
// Update labels including the released one

.github/scripts/save_pr_details.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
module.exports = async ({context, core}) => {
2-
const fs = require('fs');
3-
const filename = "pr.txt";
1+
const fs = require('node:fs');
2+
module.exports = async ({ context, core }) => {
3+
const filename = 'pr.txt';
44

55
try {
6-
fs.writeFileSync(`./${filename}`, JSON.stringify(context.payload));
6+
fs.writeFileSync(`./${filename}`, JSON.stringify(context.payload));
77

8-
return `PR successfully saved ${filename}`;
8+
return `PR successfully saved ${filename}`;
99
} catch (err) {
10-
core.setFailed("Failed to save PR details");
11-
console.error(err);
10+
core.setFailed('Failed to save PR details');
11+
console.error(err);
1212
}
13-
}
13+
};

biome.json

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3-
"organizeImports": {
4-
"enabled": true
2+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
3+
"assist": {
4+
"actions": {
5+
"source": {
6+
"organizeImports": "on"
7+
}
8+
}
59
},
610
"linter": {
711
"enabled": true,
812
"rules": {
9-
"recommended": true
13+
"recommended": true,
14+
"style": {
15+
"noParameterAssign": "error",
16+
"useAsConstAssertion": "error",
17+
"useDefaultParameterLast": "error",
18+
"useEnumInitializers": "error",
19+
"useSelfClosingElements": "error",
20+
"useSingleVarDeclarator": "error",
21+
"noUnusedTemplateLiteral": "error",
22+
"useNumberNamespace": "error",
23+
"noInferrableTypes": "error",
24+
"noUselessElse": "error"
25+
}
1026
}
1127
},
1228
"formatter": {
@@ -25,15 +41,24 @@
2541
}
2642
},
2743
"files": {
28-
"ignore": [
29-
"node_modules",
30-
"coverage",
31-
"lib",
32-
"cdk.out",
33-
"site",
34-
".aws-sam",
35-
"**/*.generated.js",
36-
"**/*.generated.d.ts"
44+
"includes": [
45+
"**",
46+
"!**/.cache",
47+
"!**/.claude",
48+
"!**/.vscode",
49+
"!**/.amazonq",
50+
"!**/api",
51+
"!**/site",
52+
"!**/.devcontainer",
53+
"!**/node_modules",
54+
"!**/.tsbuildinfo",
55+
"!**/coverage",
56+
"!**/lib",
57+
"!**/cdk.out",
58+
"!**/site",
59+
"!**/.aws-sam",
60+
"!**/*.generated.js",
61+
"!**/*.generated.d.ts"
3762
]
3863
}
3964
}

docs/features/kafka.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ When processing large Kafka messages in Lambda, be mindful of memory limitations
333333

334334
=== "Handling Large Messages"
335335

336-
```typescript hl_lines="18-20"
337-
--8<-- "examples/snippets/kafka/advancedHandlingLargeMessages.ts:6"
336+
```typescript hl_lines="22-23"
337+
--8<-- "examples/snippets/kafka/advancedHandlingLargeMessages.ts:9"
338338
```
339339

340340
For large messages, consider these proven approaches:

0 commit comments

Comments
 (0)