Skip to content

Commit f065bce

Browse files
committed
chore: upgrade build tools and modernize configuration
- Upgrade to googleapis/release-please-action@v4 - Update Node.js version to 24 in CI/CD - Remove NPM_TOKEN (using trusted publishers) - Upgrade ESLint to v9 with flat config format - Upgrade Prettier and eslint-config-prettier to latest - Add npm run format and npm run lint scripts - Disable ESLint formatting rules (delegated to Prettier) - Add .prettierignore to exclude CHANGELOG.md - Fix ESLint warnings (unused error variables) - Add CLAUDE.md and .claude to .gitignore
1 parent 755bf96 commit f065bce

File tree

13 files changed

+292
-207
lines changed

13 files changed

+292
-207
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"rules": {
33
"indent": 0,
4+
"quotes": 0,
5+
"linebreak-style": 0,
6+
"semi": 0,
7+
"comma-dangle": 0,
8+
"comma-style": 0,
9+
"arrow-body-style": 0,
10+
"arrow-parens": 0,
411
"no-await-in-loop": 0,
512
"require-atomic-updates": 0
613
},

.github/workflows/release.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,21 @@ jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: google-github-actions/release-please-action@v3
16+
- uses: googleapis/release-please-action@v4
1717
id: release
1818
with:
1919
release-type: node
20-
package-name: ${{vars.NPM_MODULE_NAME}}
21-
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
2220
# The logic below handles the npm publication:
23-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2422
# these if statements ensure that a publication only occurs when
2523
# a new release is created:
2624
if: ${{ steps.release.outputs.release_created }}
27-
- uses: actions/setup-node@v3
25+
- uses: actions/setup-node@v4
2826
with:
29-
node-version: 20
27+
node-version: 24
3028
registry-url: 'https://registry.npmjs.org'
3129
if: ${{ steps.release.outputs.release_created }}
3230
- run: npm ci
3331
if: ${{ steps.release.outputs.release_created }}
3432
- run: npm publish --provenance --access public
35-
env:
36-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3733
if: ${{ steps.release.outputs.release_created }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,7 @@ dist
103103
# TernJS port file
104104
.tern-port
105105

106+
# Claude Code
107+
CLAUDE.md
108+
.claude
106109

.ncurc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
'use strict';
2+
13
module.exports = {
24
upgrade: true,
35
reject: [
46
// Block package upgrades that moved to ESM
5-
'nanoid',
6-
'eslint-config-prettier'
7+
'nanoid'
78
]
89
};

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
package-lock.json
3+
CHANGELOG.md

.prettierrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = {
24
printWidth: 160,
35
tabWidth: 4,

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
const { FlatCompat } = require('@eslint/eslintrc');
4+
const js = require('@eslint/js');
5+
6+
const compat = new FlatCompat({
7+
baseDirectory: __dirname,
8+
recommendedConfig: js.configs.recommended
9+
});
10+
11+
module.exports = [
12+
{
13+
ignores: ['node_modules/**', 'examples/**']
14+
},
15+
...compat.extends('nodemailer', 'prettier'),
16+
{
17+
languageOptions: {
18+
ecmaVersion: 2020,
19+
sourceType: 'script',
20+
globals: {
21+
BigInt: 'readonly'
22+
}
23+
},
24+
rules: {
25+
// Disable all formatting rules (handled by Prettier)
26+
indent: 0,
27+
quotes: 0,
28+
'linebreak-style': 0,
29+
semi: 0,
30+
'comma-dangle': 0,
31+
'comma-style': 0,
32+
'arrow-body-style': 0,
33+
'arrow-parens': 0,
34+
// Keep these disabled
35+
'no-await-in-loop': 0,
36+
'require-atomic-updates': 0
37+
}
38+
}
39+
];

lib/embeddings-query.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ async function embeddingsQuery(apiToken, opts) {
150150
promptText = promptText.substr(0, MAX_ALLOWED_TEXT_LENGTH);
151151
}
152152

153-
// eslint-disable-next-line no-constant-condition
154153
while (true) {
155154
prompt = `${SCHEMA_PROMPT}
156155

lib/generate-embeddings.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class Embedder {
156156
subject = (value || '').toString().trim();
157157
try {
158158
subject = libmime.decodeWords(subject);
159-
} catch (err) {
159+
} catch {
160160
// ignore?
161161
}
162162
if (subject) {
@@ -238,15 +238,15 @@ class Embedder {
238238
try {
239239
const parsedUrl = new URL(part.url);
240240
return `${parsedUrl.protocol}//${parsedUrl.host}`;
241-
} catch (err) {
241+
} catch {
242242
return ' ';
243243
}
244244
}
245245
return '';
246246
})
247247
.join('');
248248
}
249-
} catch (err) {
249+
} catch {
250250
// ignore?
251251
}
252252

@@ -264,7 +264,7 @@ class Embedder {
264264
let addr = address.address || '';
265265
try {
266266
name = libmime.decodeWords(name);
267-
} catch (err) {
267+
} catch {
268268
// ignore?
269269
}
270270

lib/generate-summary.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ async function generateSummary(message, apiToken, opts) {
184184
promptText = promptText.substr(0, MAX_ALLOWED_TEXT_LENGTH);
185185
}
186186

187-
// eslint-disable-next-line no-constant-condition
188187
while (true) {
189188
content.text = promptText;
190189
prompt = `${userPrompt}

0 commit comments

Comments
 (0)