Skip to content

Commit 85e3281

Browse files
authored
Merge pull request #533 from abraham/copilot/update-eslint-to-v9
Migrate linting setup to ESLint v9 (flat config)
2 parents e1e2827 + e334f59 commit 85e3281

2 files changed

Lines changed: 36 additions & 25 deletions

File tree

‎eslint.config.js‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import js from '@eslint/js';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
});
13+
14+
export default [
15+
...compat.config({
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
ecmaVersion: 'latest',
19+
sourceType: 'module',
20+
project: './tsconfig.lint.json',
21+
},
22+
plugins: ['@typescript-eslint', 'jest'],
23+
extends: [
24+
'eslint:recommended',
25+
'plugin:@typescript-eslint/eslint-recommended',
26+
'plugin:@typescript-eslint/recommended',
27+
'plugin:jest/recommended',
28+
'plugin:import/errors',
29+
'plugin:import/typescript',
30+
],
31+
}),
32+
];

‎package.json‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"build": "tsc",
1212
"format": "prettier . --write",
13-
"lint:eslint": "eslint src --ext .ts",
13+
"lint:eslint": "eslint src",
1414
"lint:prettier": "prettier . --check",
1515
"lint": "npm run lint:eslint && npm run lint:prettier",
1616
"pkg-ok": "pkg-ok",
@@ -37,11 +37,12 @@
3737
},
3838
"homepage": "https://github.com/abraham/remotedata#readme",
3939
"devDependencies": {
40+
"@eslint/eslintrc": "^3.0.0",
41+
"@eslint/js": "^9.0.0",
4042
"@types/jest": "^30.0.0",
4143
"@typescript-eslint/eslint-plugin": "^8.0.0",
4244
"@typescript-eslint/parser": "^8.0.0",
43-
"eslint": "^8.0.0",
44-
"eslint-plugin-deprecation": "^3.0.0",
45+
"eslint": "^9.0.0",
4546
"eslint-plugin-import": "^2.0.0",
4647
"eslint-plugin-jest": "^29.0.1",
4748
"jest": "^30.0.3",
@@ -78,28 +79,6 @@
7879
"node"
7980
]
8081
},
81-
"eslintConfig": {
82-
"root": true,
83-
"parser": "@typescript-eslint/parser",
84-
"parserOptions": {
85-
"ecmaVersion": "latest",
86-
"sourceType": "module",
87-
"project": "./tsconfig.lint.json"
88-
},
89-
"plugins": [
90-
"@typescript-eslint",
91-
"jest"
92-
],
93-
"extends": [
94-
"eslint:recommended",
95-
"plugin:@typescript-eslint/eslint-recommended",
96-
"plugin:@typescript-eslint/recommended",
97-
"plugin:jest/recommended",
98-
"plugin:import/errors",
99-
"plugin:import/typescript",
100-
"plugin:deprecation/recommended"
101-
]
102-
},
10382
"prettier": {
10483
"singleQuote": true,
10584
"trailingComma": "all"

0 commit comments

Comments
 (0)