-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.cjs
74 lines (74 loc) · 2.03 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jsx-a11y/recommended',
'prettier',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
},
plugins: ['react', '@typescript-eslint', 'jsx-a11y'],
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^React$',
},
],
// This rule was so noicy so let's turn it off and see how that works
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'import/newline-after-import': ['error'],
'import/no-unresolved': ['error', { ignore: ['^@'] }],
'react/no-array-index-key': ['error'],
'react/no-typos': ['error'],
'react/destructuring-assignment': ['error', 'always'],
'react/prop-types': 'off',
'react/jsx-uses-react': 'off', // because React 17
'react/react-in-jsx-scope': 'off', // because React 17
'react/jsx-filename-extension': [
'error',
{
extensions: ['.jsx', '.tsx'],
},
],
'react/display-name': 'off',
'jsx-a11y/accessible-emoji': ['warn'],
'jsx-a11y/control-has-associated-label': ['warn'],
'jsx-a11y/label-has-associated-control': [
'warn',
{
labelComponents: [],
labelAttributes: [],
controlComponents: [],
assert: 'either',
depth: 25,
},
],
},
}