Skip to content

Commit 337ecbf

Browse files
VIA-579 AS/AJ Update eslint config with new flat config
1 parent 55b1e7a commit 337ecbf

File tree

3 files changed

+902
-2090
lines changed

3 files changed

+902
-2090
lines changed

eslint.config.mjs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import nextVitals from "eslint-config-next/core-web-vitals";
3+
import tsPlugin from "@typescript-eslint/eslint-plugin";
4+
import nextTs from "eslint-config-next/typescript";
45

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
7-
8-
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
});
11-
12-
const eslintConfig = [{
13-
ignores: [
6+
const eslintConfig = defineConfig([
7+
...nextVitals,
8+
...nextTs,
9+
{
10+
rules: {
11+
"@typescript-eslint/no-unused-vars": "error",
12+
},
13+
plugins: {
14+
"@typescript-eslint": tsPlugin,
15+
}
16+
},
17+
globalIgnores([
1418
"node_modules/**",
1519
".next/**",
1620
"out/**",
@@ -25,16 +29,7 @@ const eslintConfig = [{
2529
"playwright-report/**",
2630
"pact/**",
2731
"performance/report",
28-
]
29-
}, ...compat.extends(
30-
"next/core-web-vitals",
31-
"next/typescript",
32-
"prettier",
33-
"next",
34-
), {
35-
"rules": {
36-
"@typescript-eslint/no-unused-vars": "error",
37-
}
38-
}];
32+
]),
33+
]);
3934

4035
export default eslintConfig;

0 commit comments

Comments
 (0)