-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
194 lines (186 loc) · 4.71 KB
/
.eslintrc.cjs
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
module.exports = {
root: true,
env: { node: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'prettier',
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'unused-imports', 'node', 'import', 'deprecation', 'unicorn'],
rules: {
'max-lines': ['error', { max: 100, skipBlankLines: true, skipComments: true }],
'indent': ['error', 'tab', { SwitchCase: 1 }],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'no-empty': 'error',
'no-duplicate-imports': 'error',
'no-promise-executor-return': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
'no-unreachable-loop': 'error',
'no-use-before-define': 'error',
'no-multiple-empty-lines': 'error',
'no-trailing-spaces': 'error',
'require-await': 'error',
'no-var': 'error',
'no-labels': 'error',
'no-inline-comments': 'error',
'eqeqeq': 'error',
'no-eval': 'error',
'no-implicit-globals': 'error',
'no-useless-call': 'error',
'curly': ['error', 'all'],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: [
'import',
'let',
'const',
'var',
'return',
'throw',
'if',
'for',
'switch',
'continue',
'break',
'class',
'do',
'try',
'export',
'function',
'while',
'block',
],
next: '*',
},
{
blankLine: 'any',
prev: ['singleline-let', 'singleline-const', 'singleline-var'],
next: ['singleline-let', 'singleline-const', 'singleline-var'],
},
{
blankLine: 'any',
prev: 'import',
next: 'import',
},
{
blankLine: 'always',
prev: '*',
next: [
'return',
'throw',
'if',
'for',
'switch',
'continue',
'break',
'class',
'do',
'try',
'export',
'function',
'while',
'block',
],
},
],
'no-restricted-imports': [
'error',
{
name: 'lodash',
message: 'The year is not 2015 anymore',
},
],
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': ['error'],
'@typescript-eslint/ban-ts-comment': ['error'],
'@typescript-eslint/ban-tslint-comment': ['error'],
'@typescript-eslint/no-require-imports': ['error'],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'explicit', overrides: { constructors: 'off' } },
],
'unused-imports/no-unused-imports': 'error',
'import/default': ['error'],
'import/no-absolute-path': ['error'],
'import/no-self-import': ['error'],
'import/no-cycle': ['error'],
'import/no-useless-path-segments': ['error'],
'import/export': ['error'],
'import/no-deprecated': ['error'],
'import/no-extraneous-dependencies': ['error'],
'import/no-mutable-exports': ['error'],
'import/no-unused-modules': ['error'],
'import/no-commonjs': ['error'],
'import/no-amd': ['error'],
'import/first': ['error'],
'import/exports-last': ['error'],
'import/no-duplicates': ['error'],
'import/newline-after-import': ['error'],
'import/no-named-default': ['error'],
'import/no-anonymous-default-export': ['error'],
'import/order': [
'error',
{
pathGroups: [
{
pattern: '@/**',
group: 'external',
position: 'after',
},
],
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
},
],
'node/no-sync': 'error',
'deprecation/deprecation': 'error',
'unicorn/catch-error-name': 'error',
'unicorn/new-for-builtins': 'error',
'unicorn/prefer-node-protocol': 'error',
'unicorn/no-new-buffer': 'error',
'unicorn/throw-new-error': 'error',
'unicorn/text-encoding-identifier-case': 'error',
'unicorn/switch-case-braces': 'error',
'unicorn/prefer-module': 'error',
'unicorn/no-empty-file': 'error',
},
overrides: [
{
files: ['commitlint.config.cjs', './tests/**/*'],
rules: {
'max-lines': 'off',
},
},
{
files: ['./scripts/onboarding.js', './src/services/logger.service.ts'],
rules: {
'no-console': 'off',
},
},
{
files: ['./**/*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'import/no-commonjs': 'off',
'unicorn/prefer-module': 'off',
},
},
],
};