-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
140 lines (138 loc) · 4.44 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
139
140
module.exports = {
root: true,
parser: '@babel/eslint-parser',
extends: [
'eslint:recommended',
'@react-native-community',
'plugin:react/recommended',
'plugin:prettier/recommended'
],
plugins: ['import', 'react', 'react-hooks', 'unused-imports', 'jest', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unstable-nested-components': 'off',
'react/jsx-newline': [2, { prevent: true, allowMultilines: true }],
'import/order': [
'error',
{
groups: [
['external', 'builtin'],
'internal',
['sibling', 'parent'],
'index',
],
pathGroups: [
{
pattern: '@(react|react-native)',
group: 'external',
position: 'before',
},
{
pattern:
'@(@app|@shared|@features|@screens|@entities|@assets|@jobs|@widgets)/**',
group: 'internal',
},
{
pattern: '@(@images)',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['internal', 'react'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'react-hooks/rules-of-hooks': 'warn',
'constructor-super': 'warn',
'no-var': 'warn',
'no-caller': 'warn',
'array-callback-return': 'warn',
'no-eval': 'warn',
'no-extend-native': 'warn',
eqeqeq: ['warn', 'always'],
'no-script-url': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
'no-nested-ternary': 'warn',
'no-unneeded-ternary': 'warn',
'no-debugger': 'warn',
'no-empty': 'warn',
'no-unused-labels': 'warn',
'prefer-const': 'warn',
// Required for unused-imports
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'react-hooks/exhaustive-deps': 'warn',
'no-case-declarations': 'warn',
'no-unsafe-optional-chaining': 'warn',
'react/prop-types': 'warn',
'react/jsx-key': 'warn',
'react/jsx-no-duplicate-props': 'warn',
'react/jsx-no-target-blank': 'warn',
'react/jsx-no-undef': 'warn',
'react/no-danger-with-children': 'warn',
'react/no-deprecated': 'warn',
'react/no-direct-mutation-state': 'warn',
'react/no-find-dom-node': 'warn',
'react/no-is-mounted': 'warn',
'react/no-unescaped-entities': 'warn',
'react/no-unknown-property': 'warn',
'react/no-unsafe': 'warn',
'react/require-render-return': 'warn',
'react/display-name': 'off',
// This option generate warning messages from parsing packages inside
// node_modules, which we technically don't care about. Plus, this option
// also just don't seem to work. So, disable it for now.
// 'import/no-cycle': 'error',
'import/no-cycle': 'off',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
rules: {
'no-shadow': 'off',
'no-undef': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-duplicate-enum-values': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
};