Skip to content

chore: bump biome formatter to next major & reformat #4145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 16 additions & 15 deletions .github/scripts/constants.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
module.exports = Object.freeze({
/** @type {string} */
// Values: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
"PR_ACTION": process.env.PR_ACTION?.replace(/"/g, '') || "",
PR_ACTION: process.env.PR_ACTION?.replace(/"/g, '') || '',

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

/** @type {string} */
"PR_BODY": process.env.PR_BODY || "",
PR_BODY: process.env.PR_BODY || '',

/** @type {string} */
"PR_TITLE": process.env.PR_TITLE || "",
PR_TITLE: process.env.PR_TITLE || '',

/** @type {number} */
"PR_NUMBER": process.env.PR_NUMBER || 0,
PR_NUMBER: process.env.PR_NUMBER || 0,

/** @type {string} */
"PR_IS_MERGED": process.env.PR_IS_MERGED || "false",
PR_IS_MERGED: process.env.PR_IS_MERGED || 'false',

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

/** @type {string} */
"LABEL_BLOCK_REASON": "need-issue",
LABEL_BLOCK_REASON: 'need-issue',

/** @type {string} */
"LABEL_PENDING_RELEASE": "pending-release",
LABEL_PENDING_RELEASE: 'pending-release',

/** @type {string} */
"LABEL_RELEASED": "completed",
LABEL_RELEASED: 'completed',

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

/** @type {string[]} */
"IGNORE_AUTHORS": ["dependabot[bot]"],
IGNORE_AUTHORS: ['dependabot[bot]'],

/** @type {RegExp} */
"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/
});
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/,
});
12 changes: 7 additions & 5 deletions .github/scripts/download_pr_artifact.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = async ({github, context, core}) => {
const fs = require('fs');
const fs = require('node:fs');

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

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

const matchArtifact = artifacts.data.artifacts.filter(artifact => artifact.name == "pr")[0];
const matchArtifact = artifacts.data.artifacts.filter(
(artifact) => artifact.name === 'pr'
)[0];

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

core.info("Saving artifact found", artifact);
core.info('Saving artifact found', artifact);

fs.writeFileSync('pr.zip', Buffer.from(artifact.data));
}
};
7 changes: 3 additions & 4 deletions .github/scripts/label_pr_based_on_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ module.exports = async ({ github, context, core }) => {
});

return;
} else {
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);
miss += 1;
}
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);
miss += 1;
}
} finally {
if (miss == Object.keys(labels).length) {
if (miss === Object.keys(labels).length) {
core.notice(
`PR ${PR_NUMBER} title '${PR_TITLE}' contain any of the release-related types; skipping...`
);
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/label_related_issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = async ({ github, context, core }) => {
return core.notice('Author in IGNORE_AUTHORS list; skipping...');
}

if (PR_IS_MERGED == 'false') {
if (PR_IS_MERGED === 'false') {
return core.notice('Only merged PRs to avoid spam; skipping');
}

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"type": "commonjs"
}
}
4 changes: 2 additions & 2 deletions .github/scripts/post_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const fetchIssues = async ({
});

return issues.filter(
(issue) => Object(issue).hasOwnProperty('pull_request') === false
(issue) => Object.hasOwn(Object(issue), 'pull_request') === false
);
} catch (error) {
core.setFailed(error);
Expand Down Expand Up @@ -84,7 +84,7 @@ const notifyRelease = async ({

// Remove staged label; keep existing ones
const labels = issue.labels
.filter((label) => label.name != LABEL_PENDING_RELEASE)
.filter((label) => label.name !== LABEL_PENDING_RELEASE)
.map((label) => label.name);

// Update labels including the released one
Expand Down
16 changes: 8 additions & 8 deletions .github/scripts/save_pr_details.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = async ({context, core}) => {
const fs = require('fs');
const filename = "pr.txt";
const fs = require('node:fs');
module.exports = async ({ context, core }) => {
const filename = 'pr.txt';

try {
fs.writeFileSync(`./${filename}`, JSON.stringify(context.payload));
fs.writeFileSync(`./${filename}`, JSON.stringify(context.payload));

return `PR successfully saved ${filename}`;
return `PR successfully saved ${filename}`;
} catch (err) {
core.setFailed("Failed to save PR details");
console.error(err);
core.setFailed('Failed to save PR details');
console.error(err);
}
}
};
51 changes: 38 additions & 13 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"formatter": {
Expand All @@ -25,15 +41,24 @@
}
},
"files": {
"ignore": [
"node_modules",
"coverage",
"lib",
"cdk.out",
"site",
".aws-sam",
"**/*.generated.js",
"**/*.generated.d.ts"
"includes": [
"**",
"!**/.cache",
"!**/.claude",
"!**/.vscode",
"!**/.amazonq",
"!**/api",
"!**/site",
"!**/.devcontainer",
"!**/node_modules",
"!**/.tsbuildinfo",
"!**/coverage",
"!**/lib",
"!**/cdk.out",
"!**/site",
"!**/.aws-sam",
"!**/*.generated.js",
"!**/*.generated.d.ts"
]
}
}
4 changes: 2 additions & 2 deletions docs/features/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ When processing large Kafka messages in Lambda, be mindful of memory limitations

=== "Handling Large Messages"

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

For large messages, consider these proven approaches:
Expand Down
Loading