Skip to content

Commit 903fa82

Browse files
vveerrggclaude
andcommitted
chore(lint): migrate ESLint 8 to 9 with flat config
Replace legacy .eslintrc.js with eslint.config.mjs (flat config). Upgrade eslint ^8.45 -> ^9.27, @typescript-eslint/* ^6.2 -> ^8.32, add @eslint/js. Disable no-undef (TypeScript handles this). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0acec22 commit 903fa82

3 files changed

Lines changed: 45 additions & 28 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsparser from '@typescript-eslint/parser';
4+
5+
export default [
6+
{
7+
ignores: ['dist/**', 'node_modules/**', 'coverage/**', 'examples/**'],
8+
},
9+
{
10+
files: ['**/*.ts'],
11+
languageOptions: {
12+
parser: tsparser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
},
17+
globals: {
18+
console: 'readonly',
19+
process: 'readonly',
20+
},
21+
},
22+
plugins: {
23+
'@typescript-eslint': tseslint,
24+
},
25+
rules: {
26+
...eslint.configs.recommended.rules,
27+
...tseslint.configs.recommended.rules,
28+
'no-undef': 'off',
29+
'@typescript-eslint/no-explicit-any': 'off',
30+
'@typescript-eslint/explicit-function-return-type': 'off',
31+
'@typescript-eslint/explicit-module-boundary-types': 'off',
32+
'@typescript-eslint/no-unused-vars': ['error', {
33+
argsIgnorePattern: '^_',
34+
varsIgnorePattern: '^_',
35+
caughtErrorsIgnorePattern: '^_',
36+
}],
37+
},
38+
},
39+
];

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"test:coverage": "vitest run --coverage",
1414
"test:ui": "vitest --ui",
1515
"dev": "tsc -w",
16-
"lint": "eslint . --ext .ts",
17-
"lint:fix": "eslint . --ext .ts --fix",
16+
"lint": "eslint .",
17+
"lint:fix": "eslint . --fix",
1818
"prepublishOnly": "npm run lint && npm run test && npm run build"
1919
},
2020
"main": "dist/nodes/index.js",
@@ -60,11 +60,12 @@
6060
"@types/node": "^20.19.33",
6161
"@types/node-red": "^1.3.5",
6262
"@types/ws": "^8.18.1",
63-
"@typescript-eslint/eslint-plugin": "^6.2.0",
64-
"@typescript-eslint/parser": "^6.2.0",
63+
"@eslint/js": "^9.27.0",
64+
"@typescript-eslint/eslint-plugin": "^8.32.1",
65+
"@typescript-eslint/parser": "^8.32.1",
6566
"@vitest/coverage-v8": "^3.2.4",
6667
"@vitest/ui": "^3.2.4",
67-
"eslint": "^8.45.0",
68+
"eslint": "^9.27.0",
6869
"node-red": "^4.1.5",
6970
"node-red-node-test-helper": "^0.3.6",
7071
"typescript": "^5.9.3",

0 commit comments

Comments
 (0)