-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
111 lines (111 loc) · 2.97 KB
/
.eslintrc.js
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
module.exports = {
extends: [
'react-app',
'plugin:import/typescript',
'plugin:jest/recommended',
'prettier',
],
plugins: ['prettier', 'react', 'react-hooks', '@typescript-eslint', 'jest'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
es6: true,
browser: true,
node: true,
jest: true,
},
rules: {
'array-callback-return': 'off',
'arrow-parens': 'off',
'comma-dangle': 'off',
'consistent-return': 'off',
eqeqeq: 'off',
'function-paren-newline': 'off',
'import/extensions': 'error',
'import/first': 'error',
'import/order': 'error',
'import/no-deprecated': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'error',
'import/prefer-default-export': 'off',
'jest/consistent-test-it': [
'error',
{
fn: 'it',
withinDescribe: 'it',
},
],
'jest/no-disabled-tests': 'error',
'jest/no-mocks-import': 'off',
indent: 'off', // in conflict with prettier
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-redundant-roles': 'off',
'max-len': 0, // in conflict with prettier
'no-confusing-arrow': 'off',
'no-else-return': 'error',
'no-nested-ternary': 'off',
'no-return-assign': 'off',
'no-param-reassign': 'off',
'no-undef': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
'object-curly-newline': 'off',
'prefer-const': 'error',
'prefer-destructuring': 'error',
'prefer-rest-params': 'off',
'prettier/prettier': 'error',
'react/default-props-match-prop-types': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-boolean-value': 2,
'react/jsx-filename-extension': 'off',
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
'react/no-array-index-key': 2,
'react/no-unescaped-entities': 'off',
'react/no-unused-state': 'off',
'react/prefer-stateless-function': 'error',
'react/prop-types': 'error',
'react/require-default-props': 2,
'react/sort-comp': 2,
semi: 'off',
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'none',
ignoreRestSiblings: true,
},
],
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: { jsx: true },
warnOnUnsupportedTypeScriptVersion: true,
},
},
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
}