-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
138 lines (135 loc) · 4.39 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
135
136
137
138
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: [
'@typescript-eslint',
'eslint-plugin-no-inline-styles',
'jest',
'react-hooks',
'simple-import-sort',
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
globals: {
__DEV__: true,
device: false,
expect: false,
waitFor: false,
element: false,
by: false,
},
env: {
'jest/globals': true,
},
rules: {
// Disable rules
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
// 'import/prefer-default-export': 0,
// 'import/no-cycle': 0,
// 'class-methods-use-this': 0,
// '@typescript-eslint/interface-name-prefix': 0,
// 'import/order': 0,
// 'no-console': 0,
// 'prefer-destructuring': 0,
// 'react/destructuring-assignment': 0,
// 'react/jsx-filename-extension': 0,
// 'no-useless-catch': 0,
// 'import/no-extraneous-dependencies': 0,
// '@typescript-eslint/explicit-function-return-type': 0,
// 'no-plusplus': 0,
// 'no-case-declarations': 0,
// 'consistent-return': 0,
// '@typescript-eslint/no-use-before-define': 0,
// 'no-underscore-dangle': 0,
// 'no-restricted-syntax': 0,
// 'no-param-reassign': 0,
// '@typescript-eslint/camelcase': 0,
// 'react/jsx-fragments': 0,
// 'react/jsx-props-no-spreading': 0,
// 'react/require-default-props': 0,
// 'no-unused-expressions': 0,
// 'max-classes-per-file': 0,
// eqeqeq: 'off',
// 'react/sort-comp': 0,
// 'react/no-array-index-key': 0,
// Enable rules
'no-inline-styles/no-inline-styles': 'error',
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-parameter-properties': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': false,
'ts-ignore': false,
},
],
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false,
Function: false,
},
extendDefaults: true,
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'simple-import-sort/imports': [
'error',
{
groups: [
// Side effect imports.
['^\\u0000'],
// Packages. `react` related packages come first.
['^react', '^@?\\w'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
'simple-import-sort/exports': 'error',
},
settings: {
'import/resolver': {
'babel-module': {
allowExistingDirectories: true,
},
},
},
}