-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
67 lines (66 loc) · 2.3 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import pluginJsxRuntimeConfig from "eslint-plugin-react/configs/jsx-runtime.js";
import pluginReactHooks_nonFlat from "eslint-plugin-react-hooks";
export default [
{ settings: { react: { version: "detect" } } },
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReactConfig,
pluginJsxRuntimeConfig,
{
plugins: {
"react-hooks": pluginReactHooks_nonFlat,
},
rules: pluginReactHooks_nonFlat.configs.recommended.rules,
},
{
ignores: ["**/__generated__/**/*", "scripts/**/*"],
},
{
rules: {
"no-console": 1,
"no-debugger": "warn",
"no-prototype-builtins": 0,
"no-restricted-imports": [
"error",
{
paths: [
"@mui/icons-material",
{
name: "@apollo/client",
importNames: ["gql"],
message: "Import 'gql' from '@/__generated__'",
},
{
name: "@/__generated__/graphql",
importNames: ["Maybe"],
message:
"Import 'Maybe' from 'graphql/jsutils/Maybe'",
},
],
patterns: ["@mui/icons-material/*"],
},
],
quotes: [
"warn",
"double",
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
"react/prop-types": 1,
semi: ["warn", "always"],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"react/no-unescaped-entities": 1,
"react/no-deprecated": 1,
},
},
];