This repository was archived by the owner on Mar 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy patheslint.config.js
More file actions
76 lines (70 loc) · 2.51 KB
/
eslint.config.js
File metadata and controls
76 lines (70 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import reactHooks from "eslint-plugin-react-hooks";
import { defineConfig, globalIgnores } from "eslint/config";
import globals from "globals";
const compat = new FlatCompat({
baseDirectory: new URL('.', import.meta.url).pathname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default defineConfig([
{
extends: fixupConfigRules(
compat.extends(
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier",
),
),
plugins: {
"react-hooks": fixupPluginRules(reactHooks),
},
settings: {
react: { version: "detect" },
"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".tsx", ".json"],
},
typescript: {
project: ["./tsconfig.json"],
extensions: [".js", ".jsx", ".ts", ".tsx"],
alwaysTryTypes: true,
},
},
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-function-type": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"import/no-anonymous-default-export": "warn",
"import/no-unresolved": "warn",
"jsx-a11y/anchor-is-valid": "warn",
"no-prototype-builtins": "error",
"no-undef": "warn",
"no-unused-vars": "warn",
"prefer-const": "error",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "warn",
"react/display-name": "warn",
"react/jsx-key": "warn",
"react/prop-types": "warn",
"react/react-in-jsx-scope": "warn",
eqeqeq: "warn",
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
globalIgnores(["**/node_modules", "**/build", "coverage**"]),
]);