-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
executable file
·134 lines (134 loc) · 4.69 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
module.exports = {
root: true,
extends: [
'eslint:recommended',
'prettier',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:import/typescript',
'plugin:react/recommended',
],
plugins: ['prettier', 'promise', 'jest', 'react', 'react-hooks'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
},
env: {
es6: true,
node: true,
jest: true,
browser: true,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': ['error', { skipUndeclared: true }],
'react/no-unused-prop-types': 'error',
'react/jsx-no-useless-fragment': 'error',
'eslint-comments/no-unused-disable': 'error',
'jest/consistent-test-it': 'error',
'jest/expect-expect': 'error',
'jest/prefer-spy-on': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'array-callback-return': 'error',
camelcase: 'error',
'default-case': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'global-require': 'error',
'handle-callback-err': 'error',
'no-array-constructor': 'error',
'no-buffer-constructor': 'error',
'no-console': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'error',
'no-empty-function': 'error',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-floating-decimal': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-multi-assign': 'error',
'no-multi-str': 'error',
'no-nested-ternary': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-require': 'error',
'no-new-wrappers': 'error',
'no-new': 'error',
'no-param-reassign': ['error', { props: true }],
'no-path-concat': 'error',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-proto': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
'no-shadow': 'error',
'no-undef': ['error', { typeof: true }],
'no-undef-init': 'error',
'no-unmodified-loop-condition': 'error',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': 'error',
'no-with': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'prettier/prettier': 'error',
'require-await': 'error',
strict: 0,
yoda: ['error', 'never'],
'import/no-deprecated': 'error', // Prevents the use of deprecated imports
'import/no-dynamic-require': 'error', // Prevents the use of dynamic expressions in CJS require
'import/no-absolute-path': 'error', // Requires that all imports be specified in relative terms
'import/no-self-import': 'error', // Prevents a module importing itself
'import/no-useless-path-segments': 'error', // Prevents redundant path sections in imports
'import/no-unused-modules': 'error', // Requires that all imports be used within the file somewhere.
'import/no-extraneous-dependencies': ['error', { packageDir: ['./', '../../'] }], // Requires that all used imports appear within the package.json
'import/first': 'error', // Requires that all imports appear at the top of the file
'import/no-duplicates': 'error', // Prevents the same module being imported twice
'import/newline-after-import': 'error', // Enforces seperation between imports and module definition
'import/extensions': 'error', // Prevents the use of extensions when importing files
'import/no-unresolved': ['error', { ignore: ['@date-io/type'] }],
'import/named': 'off',
'import/order': ['error', { 'newlines-between': 'always' }],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
};