-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
.eslintrc.js
145 lines (144 loc) · 3.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
141
142
143
144
145
module.exports = {
env: {
es6: true,
jest: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
],
globals: {
__DEV__: true,
__LIB_VERSION__: true,
ENV_DEVELOPMENT: true,
},
ignorePatterns: ['*.d.ts', '/website/'],
overrides: [
{
files: ['./packages/*/src/**/*.*'],
excludedFiles: ['./**/__tests__/**/*.*'],
rules: {
'max-depth': [1, { max: 3 }],
'max-lines-per-function': [
1,
{ max: 45, skipComments: true, skipBlankLines: true },
],
'max-nested-callbacks': [1, { max: 2 }],
'max-statements': [1, { max: 10 }],
},
},
{
excludedFiles: ['./**/__tests__/**/*.*', './**/testUtils/**/*'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
files: ['packages/**/*.ts'],
parserOptions: {
project: ['./tsconfig.json'], // Specify it only for TypeScript files
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
1,
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
{
excludedFiles: ['./**/__tests__/**/*.*'],
files: ['*.ts'],
rules: {
'jest/no-export': 0,
},
},
{
files: ['./**/vest/src/**/*.*'],
excludedFiles: ['./**/__tests__/**/*.*'],
rules: {
'vest-internal/use-use': 2,
},
},
],
parser: '@typescript-eslint/parser',
plugins: ['jest', 'vest-internal'],
rules: {
complexity: [2, { max: 5 }],
'import/extensions': [0, 'ignorePackages'],
'import/first': 2,
'import/newline-after-import': 1,
'import/no-duplicates': 2,
'import/no-self-import': 2,
'import/no-unresolved': [2],
'import/no-useless-path-segments': 2,
'import/order': [
'warn',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
pathGroups: [
{
pattern: '^vx',
group: 'external',
},
{
pattern: './vx',
group: 'external',
},
],
},
],
'jest/expect-expect': 0,
'jest/no-identical-title': 0,
'jest/no-standalone-expect': 0,
'max-params': [1, { max: 4 }],
'no-console': 2,
'no-else-return': 1,
'no-implicit-globals': 2,
'no-lonely-if': 2,
'no-multi-spaces': 1,
'no-prototype-builtins': 0,
'no-trailing-spaces': [2, { ignoreComments: false }],
'no-undef': 2,
'no-unneeded-ternary': 2,
'no-unused-expressions': 2,
'no-unused-vars': 0,
'no-useless-catch': 2,
'no-useless-computed-key': 2,
'no-useless-return': 2,
'no-var': 2,
'no-warning-comments': 1,
'object-shorthand': [2, 'always', { avoidQuotes: true }],
'prefer-const': 2,
'sort-keys': [
1,
'asc',
{
natural: true,
minKeys: 4,
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
project: 'packages/*/tsconfig.json',
},
},
},
};