Skip to content

Commit 357d7a8

Browse files
chore: Update eslint to v9
1 parent f4cfe35 commit 357d7a8

File tree

4 files changed

+367
-484
lines changed

4 files changed

+367
-484
lines changed

.eslintrc.js

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

eslint.config.mjs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import react from "eslint-plugin-react";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default [...compat.extends(
19+
"eslint:recommended",
20+
"plugin:react/recommended",
21+
"plugin:@typescript-eslint/recommended",
22+
), {
23+
plugins: {
24+
react,
25+
"@typescript-eslint": typescriptEslint,
26+
},
27+
28+
languageOptions: {
29+
globals: {
30+
...globals.browser,
31+
},
32+
33+
parser: tsParser,
34+
ecmaVersion: "latest",
35+
sourceType: "module",
36+
},
37+
38+
settings: {
39+
react: {
40+
version: "detect",
41+
},
42+
},
43+
44+
rules: {},
45+
}];

0 commit comments

Comments
 (0)