-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
150 lines (134 loc) · 4.85 KB
/
.eslintrc.json
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
"parser": "@typescript-eslint/parser",
"extends": ["airbnb", "plugin:css-modules/recommended", "plugin:prettier/recommended", "plugin:compat/recommended", "prettier"],
"plugins": ["@typescript-eslint/eslint-plugin", "css-modules", "prettier", "unicorn", "import"],
"parserOptions": {
"sourceType": "module"
},
"globals": {
"__DEV__": true,
"__WEB__": true
},
"env": {
"browser": true,
"jest": true
},
"rules": {
"no-dupe-class-members": "off",
"no-undef": "off",
"no-plusplus": "off",
"class-methods-use-this": "off",
"lines-between-class-members": "off",
"no-use-before-define": "off",
"no-restricted-imports": [
"error",
{
"patterns": ["@mui/*/*/*", "!@mui/material/test-utils/*"]
}
],
// Forbid the use of extraneous packages
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
"import/no-extraneous-dependencies": "off", // ["error", { packageDir: "." }],
// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
// https://eslint.org/docs/rules/no-console
"no-console": [
"error",
{
"allow": ["warn", "error", "info"]
}
],
// Allow only special identifiers
// https://eslint.org/docs/rules/no-underscore-dangle
"no-underscore-dangle": [
"error",
{
"allow": ["__typename", "__DEV__", "__SERV__", "__default__", "__is_empty_row__"]
}
],
// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": false,
"object": false
}
},
{
"enforceForRenamedProperties": false
}
],
// Ensure <a> tags are valid
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["href"],
"aspects": ["invalidHref", "preferButton"]
}
],
// Allow .js files to use JSX syntax
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
// Functional and class components are equivalent from React’s point of view
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
"react/prefer-stateless-function": "off",
// ESLint plugin for prettier formatting
// https://github.com/prettier/eslint-plugin-prettier
"prettier/prettier": "error",
"react/forbid-prop-types": "off",
"react/destructuring-assignment": "off",
"react/jsx-props-no-spreading": "off",
"react/static-property-placement": "off",
"react/state-in-constructor": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
// TypeScript checks prop-types
"react/prop-types": "off",
// Cannot config .ts, .tsx resolution
"import/no-unresolved": "off",
"import/no-webpack-loader-syntax": "off",
"import/extensions": "off",
"import/prefer-default-export": "off",
"import/order": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "local",
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^(_|type|of|returns)"
}
],
// Type variables by Codegen can not be camelcase.
"camelcase": "off",
"css-modules/no-undef-class": [2, { "camelCase": true }],
"css-modules/no-unused-class": [2, { "camelCase": true }]
},
"settings": {
"polyfills": [
"Promise",
"fetch",
"Date.now",
"Set",
"Array.from",
"document.querySelector",
"document.head",
"Object.create",
"Object.keys",
"window.pageYOffset",
"window.pageXOffset",
"Object.entries",
"Array.isArray",
"Object.values"
]
}
}