forked from reduxjs/redux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
77 lines (74 loc) · 2.62 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
module.exports = {
extends: ['react-app', 'prettier'],
extends: [
'eslint:recommended',
'prettier',
'react-app',
'plugin:node/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
rules: {
'jsx-a11y/href-no-hash': 'off',
'react/react-in-jsx-scope': 'off',
// Taken care of by TypeScript's `noUnusedLocals` / `noUnusedParameters`
'@typescript-eslint/no-unused-vars': 'off',
// These off/not-configured-the-way-we-want lint rules we like & opt into
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: false },
],
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: '(usePossiblyImmediateEffect)',
},
],
// Todo: investigate whether we'd like these on
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/prefer-function-type': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/sort-type-constituents': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/dot-notation': 'off',
'no-empty': 'off',
'prefer-const': 'off',
'prefer-rest-params': 'off',
},
overrides: [
{
files: [
'packages/toolkit/src/tests/*.ts',
'packages/toolkit/src/**/tests/*.ts',
'packages/toolkit/src/**/tests/*.tsx',
],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'no-lone-blocks': 'off',
'no-sequences': 'off',
},
},
],
}