-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
137 lines (135 loc) · 4.21 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
module.exports = {
env: {
es6: true,
browser: true,
es2021: true,
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'prettier',
'eslint-plugin-import',
'unused-imports',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
rules: {
// Error
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
'react-hooks/rules-of-hooks': 'error',
'import/order': [
'error',
{
groups: [['external', 'builtin'], 'internal', ['sibling', 'parent'], 'index'],
pathGroups: [
{
pattern: '@(react)',
group: 'external',
position: 'before',
},
{
pattern: '@(~app|~shared|~features|~pages|~entities)/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['internal', 'react'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unused-imports/no-unused-imports': 'error',
'import/no-cycle': 'error',
'constructor-super': 'error',
'no-this-before-super': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'off',
'no-useless-rename': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-template': 'error',
'no-restricted-syntax': ['error', 'ForInStatement', 'SequenceExpression'],
'no-caller': 'error',
'no-template-curly-in-string': 'error',
'array-callback-return': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
eqeqeq: ['error', 'always'],
'no-lone-blocks': 'error',
'no-proto': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-nested-ternary': 'error',
'no-unneeded-ternary': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-unused-labels': 'error',
'prefer-const': 'error',
// Warn
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'react/display-name': 'warn',
'react/prop-types': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'no-console': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
// Off
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'no-case-declarations': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-extra-semi': 'off',
'prefer-destructuring': 'off',
camelcase: 'off',
},
},
],
settings: {
react: {
version: 'detect',
},
},
};