Skip to content

Commit 9eed611

Browse files
sirughclaude
andcommitted
fix: add ESLint config for .mjs test files and fix rettime.cjs lint
- Add ESLint flat config blocks for *.mjs files (sourceType: module, node globals) and *.test.mjs / test/mock-server.mjs (jest plugin + globals), matching the existing *.test.js pattern - Fix rettime.cjs empty catch: `catch (_) {}` → `catch { /* ignore */ }` to resolve no-unused-vars and no-empty ESLint errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 45ed7c2 commit 9eed611

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,32 @@ export default [
3030
'jest/valid-expect': 'error',
3131
},
3232
},
33+
{
34+
files: ['**/*.mjs'],
35+
languageOptions: {
36+
sourceType: 'module',
37+
globals: {
38+
...globals.node,
39+
},
40+
},
41+
},
42+
{
43+
files: ['**/*.test.mjs', 'test/mock-server.mjs'],
44+
plugins: { jest: pluginJest },
45+
languageOptions: {
46+
sourceType: 'module',
47+
globals: {
48+
...pluginJest.environments.globals.globals,
49+
...globals.node,
50+
},
51+
},
52+
rules: {
53+
'jest/no-disabled-tests': 'warn',
54+
'jest/no-focused-tests': 'error',
55+
'jest/no-identical-title': 'error',
56+
'jest/prefer-to-have-length': 'warn',
57+
'jest/valid-expect': 'error',
58+
},
59+
},
3360
pluginJs.configs.recommended,
3461
];

test/__mocks__/rettime.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Emitter {
3737
const direct = this._listeners.get(name) || [];
3838
const wildcard = this._listeners.get('*') || [];
3939
for (const fn of [...direct, ...wildcard]) {
40-
try { fn(event); } catch (_) {}
40+
try { fn(event); } catch { /* ignore */ }
4141
}
4242
return this;
4343
}

0 commit comments

Comments
 (0)