-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
118 lines (117 loc) · 2.8 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
const productionError =
process.env.NODE_ENV === 'production' ? 'error' : 'warn';
module.exports = {
env: {
browser: false,
node: true,
},
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
'plugin:unicorn/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
modules: true,
},
ecmaVersion: 2022,
jsxPragma: undefined,
project: 'tsconfig.json',
sourceType: 'module',
tsconfigRootDir: '.',
},
plugins: [
'@typescript-eslint',
'import',
'prettier',
'unicorn',
'unused-imports',
],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'arrow-parens': ['error', 'always'],
'comma-dangle': 'off',
'consistent-return': 'off',
curly: ['error', 'multi-line'],
'default-case': 'off',
'function-paren-newline': 'off',
'guard-for-in': 'off',
'implicit-arrow-linebreak': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
mjs: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-extraneous-dependencies': 'off',
'import/order': [
'error',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
},
],
'import/prefer-default-export': 'off',
'no-confusing-arrow': 'off',
'no-console': productionError,
'no-debugger': productionError,
'no-magic-numbers': ['error', { ignore: [0, 1], ignoreArrayIndexes: true }],
'no-param-reassign': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'object-curly-newline': ['error', { consistent: true }],
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-node-protocol': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
root: true,
settings: {
'import/extensions': ['.js', '.ts', '.tsx'],
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
overrides: [
{
files: '*.js',
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
},
],
};