-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
46 lines (45 loc) · 1.19 KB
/
eslint.config.mjs
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
import pluginJs from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import pluginReactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import tseslint from "typescript-eslint";
export default [
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
React: "readonly"
},
parser: tseslint.parser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: { jsx: true }
}
},
plugins: {
react: pluginReact,
"@typescript-eslint": tseslint.plugin,
"react-hooks": pluginReactHooks
},
settings: {
react: {
version: "detect"
}
},
rules: {
...pluginJs.configs.recommended.rules,
...tseslint.configs.recommended[0].rules,
...pluginReact.configs.flat.recommended.rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
}
];