@cherepanov.pavel/shareable-config 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +11 -0
- package/.editorconfig-get.js +19 -0
- package/.get-all.js +29 -0
- package/.gitattributes +1 -0
- package/.gitattributes-get.js +19 -0
- package/.gitignore +15 -0
- package/.gitignore-get.js +47 -0
- package/.vscode/.code-snippets-get.js +49 -0
- package/.vscode/all-files.code-snippets +18 -0
- package/.vscode/extensions.json +25 -0
- package/.vscode/extensions.json-get.js +43 -0
- package/.vscode/settings.json +42 -0
- package/.vscode/settings.json-get.js +43 -0
- package/.vscode/vue.code-snippets +28 -0
- package/README.md +10 -0
- package/env.json5.set.js +14 -0
- package/jsconfig.json +9 -0
- package/package.json +54 -0
- package/tools/eslint-config/configs/global.js +26 -0
- package/tools/eslint-config/configs/javascript.js +21 -0
- package/tools/eslint-config/configs/typescript.js +28 -0
- package/tools/eslint-config/configs/vue.js +43 -0
- package/tools/eslint-config/index.js +4 -0
- package/tools/eslint-config/rules/constants.js +15 -0
- package/tools/eslint-config/rules/javascript/index.js +7 -0
- package/tools/eslint-config/rules/javascript/possible-problems.js +62 -0
- package/tools/eslint-config/rules/javascript/suggestions.js +254 -0
- package/tools/eslint-config/rules/severity.js +3 -0
- package/tools/eslint-config/rules/stylistic/index.js +2 -0
- package/tools/eslint-config/rules/stylistic/jsFormatting.js +172 -0
- package/tools/eslint-config/rules/stylistic/tsFormatting.js +9 -0
- package/tools/eslint-config/rules/typescript/common.js +130 -0
- package/tools/eslint-config/rules/typescript/compatibility.js +24 -0
- package/tools/eslint-config/rules/typescript/extension.js +52 -0
- package/tools/eslint-config/rules/typescript/index.js +9 -0
- package/tools/eslint-config/rules/vue/base.js +6 -0
- package/tools/eslint-config/rules/vue/extension.js +58 -0
- package/tools/eslint-config/rules/vue/formatting.js +41 -0
- package/tools/eslint-config/rules/vue/index.js +13 -0
- package/tools/eslint-config/rules/vue/possibleProblems.js +113 -0
- package/tools/eslint-config/rules/vue/suggestions.js +83 -0
- package/tools/stylelint-config/config.js +29 -0
- package/tools/stylelint-config/rules/base.js +26 -0
- package/tools/stylelint-config/rules/conflicts.js +7 -0
- package/tools/stylelint-config/rules/order.js +42 -0
- package/tools/stylelint-config/rules/property-groups.js +404 -0
- package/tools/stylelint-config/rules/scss.js +8 -0
- package/tools/stylelint-config/rules/stylistic.js +124 -0
- package/utils/communication.js +33 -0
- package/utils/copy-with-override.js +43 -0
- package/utils/env.js +16 -0
- package/utils/file-header.js +16 -0
- package/utils/file.js +64 -0
- package/utils/merge.js +180 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ERROR, WARN } from '../severity.js';
|
|
2
|
+
|
|
3
|
+
export const possibleProblemRules = {
|
|
4
|
+
'array-callback-return': [WARN, { checkForEach: true }],
|
|
5
|
+
'constructor-super': [ERROR],
|
|
6
|
+
'for-direction': [ERROR],
|
|
7
|
+
'getter-return': [ERROR, { allowImplicit: true }],
|
|
8
|
+
'no-async-promise-executor': [ERROR],
|
|
9
|
+
'no-await-in-loop': [ERROR],
|
|
10
|
+
'no-class-assign': [ERROR],
|
|
11
|
+
'no-compare-neg-zero': [ERROR],
|
|
12
|
+
'no-cond-assign': [ERROR, 'always'],
|
|
13
|
+
'no-const-assign': [ERROR],
|
|
14
|
+
'no-constant-binary-expression': [ERROR],
|
|
15
|
+
'no-constant-condition': [ERROR],
|
|
16
|
+
'no-constructor-return': [ERROR],
|
|
17
|
+
'no-control-regex': [ERROR],
|
|
18
|
+
'no-debugger': [ERROR],
|
|
19
|
+
'no-dupe-args': [ERROR],
|
|
20
|
+
'no-dupe-class-members': [ERROR],
|
|
21
|
+
'no-dupe-else-if': [ERROR],
|
|
22
|
+
'no-dupe-keys': [ERROR],
|
|
23
|
+
'no-duplicate-case': [ERROR],
|
|
24
|
+
'no-duplicate-imports': [ERROR],
|
|
25
|
+
'no-empty-character-class': [ERROR],
|
|
26
|
+
'no-empty-pattern': [ERROR],
|
|
27
|
+
'no-ex-assign': [ERROR],
|
|
28
|
+
'no-fallthrough': [ERROR],
|
|
29
|
+
'no-func-assign': [ERROR],
|
|
30
|
+
'no-import-assign': [ERROR],
|
|
31
|
+
'no-inner-declarations': [ERROR],
|
|
32
|
+
'no-invalid-regexp': [ERROR],
|
|
33
|
+
'no-irregular-whitespace': [ERROR],
|
|
34
|
+
'no-loss-of-precision': [ERROR],
|
|
35
|
+
'no-misleading-character-class': [ERROR],
|
|
36
|
+
'no-new-native-nonconstructor': [ERROR],
|
|
37
|
+
'no-new-symbol': [ERROR],
|
|
38
|
+
'no-obj-calls': [ERROR],
|
|
39
|
+
'no-promise-executor-return': [ERROR],
|
|
40
|
+
'no-prototype-builtins': [ERROR],
|
|
41
|
+
'no-self-assign': [ERROR],
|
|
42
|
+
'no-self-compare': [ERROR],
|
|
43
|
+
'no-setter-return': [ERROR],
|
|
44
|
+
'no-sparse-arrays': [ERROR],
|
|
45
|
+
'no-template-curly-in-string': [ERROR],
|
|
46
|
+
'no-this-before-super': [ERROR],
|
|
47
|
+
'no-undef': [ERROR],
|
|
48
|
+
'no-unexpected-multiline': [ERROR],
|
|
49
|
+
'no-unmodified-loop-condition': [ERROR],
|
|
50
|
+
'no-unreachable': [ERROR],
|
|
51
|
+
'no-unreachable-loop': [ERROR],
|
|
52
|
+
'no-unsafe-finally': [ERROR],
|
|
53
|
+
'no-unsafe-negation': [ERROR],
|
|
54
|
+
'no-unsafe-optional-chaining': [ERROR, { disallowArithmeticOperators: true }],
|
|
55
|
+
'no-unused-private-class-members': [ERROR],
|
|
56
|
+
'no-unused-vars': [WARN],
|
|
57
|
+
'no-use-before-define': [ERROR, { classes: true, functions: true, variables: true }],
|
|
58
|
+
'no-useless-backreference': [ERROR],
|
|
59
|
+
'require-atomic-updates': [ERROR],
|
|
60
|
+
'use-isnan': [ERROR],
|
|
61
|
+
'valid-typeof': [ERROR, { requireStringLiterals: true }],
|
|
62
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ERROR, OFF, WARN } from '../severity.js';
|
|
2
|
+
|
|
3
|
+
export const suggestionRules = {
|
|
4
|
+
'accessor-pairs': [ERROR],
|
|
5
|
+
'arrow-body-style': [ERROR, 'always'],
|
|
6
|
+
'block-scoped-var': [ERROR],
|
|
7
|
+
'camelcase': [ERROR, { properties: 'never' }],
|
|
8
|
+
'capitalized-comments': [OFF, 'never'],
|
|
9
|
+
'class-methods-use-this': [ERROR],
|
|
10
|
+
'complexity': [OFF],
|
|
11
|
+
'consistent-return': [OFF],
|
|
12
|
+
'consistent-this': [OFF],
|
|
13
|
+
'curly': [ERROR, 'all'],
|
|
14
|
+
'default-case': [OFF],
|
|
15
|
+
'default-case-last': [ERROR],
|
|
16
|
+
'default-param-last': [ERROR],
|
|
17
|
+
'dot-notation': [ERROR],
|
|
18
|
+
'eqeqeq': [ERROR, 'always', { null: 'always' }],
|
|
19
|
+
'func-name-matching': [WARN],
|
|
20
|
+
'func-names': [WARN, 'as-needed'],
|
|
21
|
+
'func-style': [ERROR, 'declaration', { allowArrowFunctions: true }],
|
|
22
|
+
'grouped-accessor-pairs': [ERROR, 'getBeforeSet'],
|
|
23
|
+
'guard-for-in': [OFF],
|
|
24
|
+
'id-denylist': [OFF],
|
|
25
|
+
'id-length': [ERROR, {
|
|
26
|
+
min: 2,
|
|
27
|
+
exceptionPatterns: ['sort', '^a$', '^b$', 'for', '^i$'],
|
|
28
|
+
properties: 'never',
|
|
29
|
+
}],
|
|
30
|
+
'id-match': [OFF],
|
|
31
|
+
'init-declarations': [OFF],
|
|
32
|
+
'logical-assignment-operators': [ERROR, 'always', { enforceForIfStatements: true }],
|
|
33
|
+
'max-classes-per-file': [ERROR, 1],
|
|
34
|
+
'max-depth': [ERROR, 4],
|
|
35
|
+
// 'max-lines': [WARN, {
|
|
36
|
+
// max: 600,
|
|
37
|
+
// skipBlankLines: true,
|
|
38
|
+
// skipComments: true,
|
|
39
|
+
// }],
|
|
40
|
+
// 'max-lines-per-function': [WARN, {
|
|
41
|
+
// max: 120,
|
|
42
|
+
// skipBlankLines: true,
|
|
43
|
+
// skipComments: true,
|
|
44
|
+
// }],
|
|
45
|
+
'max-nested-callbacks': [WARN, { max: 5 }],
|
|
46
|
+
'max-params': [WARN, { max: 5 }],
|
|
47
|
+
'max-statements': [WARN, { max: 20 }],
|
|
48
|
+
'multiline-comment-style': [OFF],
|
|
49
|
+
'new-cap': [ERROR, {
|
|
50
|
+
capIsNew: true,
|
|
51
|
+
newIsCap: true,
|
|
52
|
+
}],
|
|
53
|
+
'no-alert': [ERROR],
|
|
54
|
+
'no-array-constructor': [ERROR],
|
|
55
|
+
'no-bitwise': [ERROR],
|
|
56
|
+
'no-caller': [ERROR],
|
|
57
|
+
'no-case-declarations': [ERROR],
|
|
58
|
+
'no-console': [WARN, { allow: ['warn', 'error', 'info'] }],
|
|
59
|
+
'no-continue': [ERROR],
|
|
60
|
+
'no-delete-var': [ERROR],
|
|
61
|
+
'no-div-regex': [ERROR],
|
|
62
|
+
'no-else-return': [ERROR, { allowElseIf: false }],
|
|
63
|
+
'no-empty': [ERROR, { allowEmptyCatch: true }],
|
|
64
|
+
'no-empty-function': [ERROR],
|
|
65
|
+
'no-empty-static-block': [ERROR],
|
|
66
|
+
'no-eq-null': [OFF],
|
|
67
|
+
'no-eval': [ERROR],
|
|
68
|
+
'no-extend-native': [ERROR],
|
|
69
|
+
'no-extra-bind': [ERROR],
|
|
70
|
+
'no-extra-boolean-cast': [ERROR],
|
|
71
|
+
'no-extra-label': [ERROR],
|
|
72
|
+
'no-global-assign': [ERROR],
|
|
73
|
+
'no-implicit-coercion': [ERROR, {
|
|
74
|
+
boolean: true,
|
|
75
|
+
number: true,
|
|
76
|
+
string: true,
|
|
77
|
+
}],
|
|
78
|
+
'no-implicit-globals': [OFF],
|
|
79
|
+
'no-implied-eval': [ERROR],
|
|
80
|
+
'no-inline-comments': [OFF],
|
|
81
|
+
'no-invalid-this': [ERROR],
|
|
82
|
+
'no-iterator': [ERROR],
|
|
83
|
+
'no-label-var': [ERROR],
|
|
84
|
+
'no-labels': [ERROR, { allowLoop: false, allowSwitch: false }],
|
|
85
|
+
'no-lone-blocks': [ERROR],
|
|
86
|
+
'no-lonely-if': [ERROR],
|
|
87
|
+
'no-loop-func': [ERROR],
|
|
88
|
+
'no-magic-numbers': [OFF],
|
|
89
|
+
'no-multi-assign': [ERROR],
|
|
90
|
+
'no-multi-str': [ERROR],
|
|
91
|
+
'no-negated-condition': [ERROR],
|
|
92
|
+
'no-nested-ternary': [ERROR],
|
|
93
|
+
'no-new': [ERROR],
|
|
94
|
+
'no-new-func': [ERROR],
|
|
95
|
+
'no-new-object': [ERROR],
|
|
96
|
+
'no-new-wrappers': [ERROR],
|
|
97
|
+
'no-nonoctal-decimal-escape': [ERROR],
|
|
98
|
+
'no-octal': [ERROR],
|
|
99
|
+
'no-octal-escape': [ERROR],
|
|
100
|
+
'no-param-reassign': [ERROR, {
|
|
101
|
+
props: true,
|
|
102
|
+
}],
|
|
103
|
+
'no-plusplus': [ERROR, { allowForLoopAfterthoughts: true }],
|
|
104
|
+
'no-proto': [ERROR],
|
|
105
|
+
'no-redeclare': [ERROR, { builtinGlobals: true }],
|
|
106
|
+
'no-regex-spaces': [ERROR],
|
|
107
|
+
'no-restricted-exports': [ERROR, {
|
|
108
|
+
restrictedNamedExports: [
|
|
109
|
+
'default', // use `export default` to provide a default export
|
|
110
|
+
'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
|
|
111
|
+
],
|
|
112
|
+
}],
|
|
113
|
+
'no-restricted-imports': [OFF, { paths: [], patterns: [] }],
|
|
114
|
+
'no-restricted-properties': [ERROR, {
|
|
115
|
+
object: 'arguments',
|
|
116
|
+
property: 'callee',
|
|
117
|
+
message: 'arguments.callee is deprecated',
|
|
118
|
+
}, {
|
|
119
|
+
object: 'global',
|
|
120
|
+
property: 'isFinite',
|
|
121
|
+
message: 'Please use Number.isFinite instead',
|
|
122
|
+
}, {
|
|
123
|
+
object: 'self',
|
|
124
|
+
property: 'isFinite',
|
|
125
|
+
message: 'Please use Number.isFinite instead',
|
|
126
|
+
}, {
|
|
127
|
+
object: 'window',
|
|
128
|
+
property: 'isFinite',
|
|
129
|
+
message: 'Please use Number.isFinite instead',
|
|
130
|
+
}, {
|
|
131
|
+
object: 'global',
|
|
132
|
+
property: 'isNaN',
|
|
133
|
+
message: 'Please use Number.isNaN instead',
|
|
134
|
+
}, {
|
|
135
|
+
object: 'self',
|
|
136
|
+
property: 'isNaN',
|
|
137
|
+
message: 'Please use Number.isNaN instead',
|
|
138
|
+
}, {
|
|
139
|
+
object: 'window',
|
|
140
|
+
property: 'isNaN',
|
|
141
|
+
message: 'Please use Number.isNaN instead',
|
|
142
|
+
}, {
|
|
143
|
+
property: '__defineGetter__',
|
|
144
|
+
message: 'Please use Object.defineProperty instead.',
|
|
145
|
+
}, {
|
|
146
|
+
property: '__defineSetter__',
|
|
147
|
+
message: 'Please use Object.defineProperty instead.',
|
|
148
|
+
}, {
|
|
149
|
+
object: 'Math',
|
|
150
|
+
property: 'pow',
|
|
151
|
+
message: 'Use the exponentiation operator (**) instead.',
|
|
152
|
+
}],
|
|
153
|
+
'no-restricted-syntax': [
|
|
154
|
+
ERROR,
|
|
155
|
+
{
|
|
156
|
+
selector: 'ForInStatement',
|
|
157
|
+
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
selector: 'LabeledStatement',
|
|
161
|
+
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
selector: 'WithStatement',
|
|
165
|
+
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
'no-return-assign': [ERROR, 'always'],
|
|
169
|
+
'no-return-await': [ERROR],
|
|
170
|
+
'no-script-url': [ERROR],
|
|
171
|
+
'no-sequences': [ERROR],
|
|
172
|
+
'no-shadow': [OFF],
|
|
173
|
+
'no-shadow-restricted-names': [ERROR],
|
|
174
|
+
'no-ternary': [OFF],
|
|
175
|
+
'no-throw-literal': [ERROR],
|
|
176
|
+
'no-undef-init': [ERROR],
|
|
177
|
+
'no-undefined': [OFF],
|
|
178
|
+
'no-underscore-dangle': [ERROR, {
|
|
179
|
+
allow: [],
|
|
180
|
+
allowAfterSuper: false,
|
|
181
|
+
allowAfterThis: true,
|
|
182
|
+
allowFunctionParams: false,
|
|
183
|
+
allowInObjectDestructuring: false,
|
|
184
|
+
}],
|
|
185
|
+
'no-unneeded-ternary': [ERROR, {
|
|
186
|
+
defaultAssignment: false,
|
|
187
|
+
}],
|
|
188
|
+
'no-unused-expressions': [ERROR, {
|
|
189
|
+
allowShortCircuit: false,
|
|
190
|
+
allowTernary: false,
|
|
191
|
+
allowTaggedTemplates: false,
|
|
192
|
+
}],
|
|
193
|
+
'no-unused-labels': [ERROR],
|
|
194
|
+
'no-useless-call': [WARN],
|
|
195
|
+
'no-useless-catch': [ERROR],
|
|
196
|
+
'no-useless-computed-key': [ERROR, { enforceForClassMembers: true }],
|
|
197
|
+
'no-useless-concat': [ERROR],
|
|
198
|
+
'no-useless-constructor': [ERROR],
|
|
199
|
+
'no-useless-escape': [ERROR],
|
|
200
|
+
'no-useless-rename': [ERROR, {
|
|
201
|
+
ignoreImport: false,
|
|
202
|
+
ignoreExport: false,
|
|
203
|
+
ignoreDestructuring: false,
|
|
204
|
+
}],
|
|
205
|
+
'no-useless-return': [ERROR],
|
|
206
|
+
'no-var': [ERROR],
|
|
207
|
+
'no-void': [ERROR, { allowAsStatement: true }],
|
|
208
|
+
'no-warning-comments': [OFF],
|
|
209
|
+
'no-with': [ERROR],
|
|
210
|
+
'object-shorthand': [ERROR, 'always', {
|
|
211
|
+
avoidQuotes: true,
|
|
212
|
+
ignoreConstructors: false,
|
|
213
|
+
}],
|
|
214
|
+
'one-var': [ERROR, 'never'],
|
|
215
|
+
'operator-assignment': [ERROR, 'always'],
|
|
216
|
+
'prefer-arrow-callback': [ERROR, {
|
|
217
|
+
allowNamedFunctions: false,
|
|
218
|
+
allowUnboundThis: true,
|
|
219
|
+
}],
|
|
220
|
+
'prefer-const': [ERROR, {
|
|
221
|
+
destructuring: 'any',
|
|
222
|
+
ignoreReadBeforeAssign: true,
|
|
223
|
+
}],
|
|
224
|
+
'prefer-destructuring': [ERROR, {
|
|
225
|
+
array: false,
|
|
226
|
+
object: true,
|
|
227
|
+
}, {
|
|
228
|
+
enforceForRenamedProperties: false,
|
|
229
|
+
}],
|
|
230
|
+
'prefer-exponentiation-operator': [ERROR],
|
|
231
|
+
'prefer-named-capture-group': [OFF],
|
|
232
|
+
'prefer-numeric-literals': [ERROR],
|
|
233
|
+
'prefer-object-has-own': [ERROR],
|
|
234
|
+
'prefer-object-spread': [ERROR],
|
|
235
|
+
'prefer-promise-reject-errors': [ERROR],
|
|
236
|
+
'prefer-regex-literals': [ERROR, { disallowRedundantWrapping: true }],
|
|
237
|
+
'prefer-rest-params': [ERROR],
|
|
238
|
+
'prefer-spread': [ERROR],
|
|
239
|
+
'prefer-template': [ERROR],
|
|
240
|
+
'radix': [ERROR],
|
|
241
|
+
'require-await': [OFF],
|
|
242
|
+
'require-unicode-regexp': [WARN],
|
|
243
|
+
'require-yield': [ERROR],
|
|
244
|
+
'sort-imports': [OFF],
|
|
245
|
+
'sort-keys': [OFF],
|
|
246
|
+
'sort-vars': [OFF],
|
|
247
|
+
'strict': [ERROR, 'never'],
|
|
248
|
+
'symbol-description': [ERROR],
|
|
249
|
+
'vars-on-top': [ERROR],
|
|
250
|
+
'yoda': [ERROR],
|
|
251
|
+
|
|
252
|
+
'line-comment-position': [OFF],
|
|
253
|
+
'unicode-bom': [ERROR, 'never'],
|
|
254
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { INDENT_SIZE, MAX_LEN } from '../constants.js';
|
|
2
|
+
import { ERROR, OFF } from '../severity.js';
|
|
3
|
+
|
|
4
|
+
/* == formatting rules for javascript == */
|
|
5
|
+
export default {
|
|
6
|
+
'@stylistic/array-bracket-newline': [OFF],
|
|
7
|
+
'@stylistic/array-bracket-spacing': [ERROR, 'never'],
|
|
8
|
+
'@stylistic/array-element-newline': [OFF],
|
|
9
|
+
'@stylistic/arrow-parens': [ERROR, 'always'],
|
|
10
|
+
'@stylistic/arrow-spacing': [ERROR, { before: true, after: true }],
|
|
11
|
+
'@stylistic/block-spacing': [ERROR, 'always'],
|
|
12
|
+
'@stylistic/brace-style': [ERROR, '1tbs', { allowSingleLine: false }],
|
|
13
|
+
'@stylistic/comma-dangle': [ERROR, 'always-multiline'],
|
|
14
|
+
'@stylistic/comma-spacing': [ERROR, { before: false, after: true }],
|
|
15
|
+
'@stylistic/comma-style': [ERROR, 'last', {
|
|
16
|
+
exceptions: {
|
|
17
|
+
ArrayExpression: false,
|
|
18
|
+
ArrayPattern: false,
|
|
19
|
+
ArrowFunctionExpression: false,
|
|
20
|
+
CallExpression: false,
|
|
21
|
+
FunctionDeclaration: false,
|
|
22
|
+
FunctionExpression: false,
|
|
23
|
+
ImportDeclaration: false,
|
|
24
|
+
NewExpression: false,
|
|
25
|
+
ObjectExpression: false,
|
|
26
|
+
ObjectPattern: false,
|
|
27
|
+
VariableDeclaration: false,
|
|
28
|
+
},
|
|
29
|
+
}],
|
|
30
|
+
'@stylistic/computed-property-spacing': [ERROR, 'never'],
|
|
31
|
+
'@stylistic/dot-location': [ERROR, 'property'],
|
|
32
|
+
'@stylistic/eol-last': [ERROR, 'always'],
|
|
33
|
+
'@stylistic/function-call-argument-newline': [ERROR, 'consistent'],
|
|
34
|
+
'@stylistic/function-call-spacing': [ERROR],
|
|
35
|
+
'@stylistic/function-paren-newline': [ERROR, 'multiline-arguments'],
|
|
36
|
+
'@stylistic/generator-star-spacing': [ERROR, { before: false, after: true }],
|
|
37
|
+
'@stylistic/implicit-arrow-linebreak': [ERROR, 'beside'],
|
|
38
|
+
'@stylistic/indent': [ERROR, INDENT_SIZE, {
|
|
39
|
+
ArrayExpression: 1,
|
|
40
|
+
CallExpression: {
|
|
41
|
+
arguments: 1,
|
|
42
|
+
},
|
|
43
|
+
FunctionDeclaration: {
|
|
44
|
+
parameters: 1,
|
|
45
|
+
body: 1,
|
|
46
|
+
},
|
|
47
|
+
FunctionExpression: {
|
|
48
|
+
parameters: 1,
|
|
49
|
+
body: 1,
|
|
50
|
+
},
|
|
51
|
+
ImportDeclaration: 1,
|
|
52
|
+
MemberExpression: 1,
|
|
53
|
+
ObjectExpression: 1,
|
|
54
|
+
StaticBlock: {
|
|
55
|
+
body: 1,
|
|
56
|
+
},
|
|
57
|
+
SwitchCase: 1,
|
|
58
|
+
VariableDeclarator: 1,
|
|
59
|
+
outerIIFEBody: 1,
|
|
60
|
+
|
|
61
|
+
flatTernaryExpressions: false,
|
|
62
|
+
ignoreComments: false,
|
|
63
|
+
}],
|
|
64
|
+
'@stylistic/indent-binary-ops': [ERROR, INDENT_SIZE],
|
|
65
|
+
'@stylistic/key-spacing': [ERROR, { beforeColon: false, afterColon: true }],
|
|
66
|
+
'@stylistic/keyword-spacing': [ERROR, {
|
|
67
|
+
before: true,
|
|
68
|
+
after: true,
|
|
69
|
+
overrides: {
|
|
70
|
+
return: { after: true },
|
|
71
|
+
throw: { after: true },
|
|
72
|
+
case: { after: true },
|
|
73
|
+
},
|
|
74
|
+
}],
|
|
75
|
+
'@stylistic/linebreak-style': [ERROR, 'unix'],
|
|
76
|
+
'@stylistic/lines-around-comment': [OFF],
|
|
77
|
+
'@stylistic/lines-between-class-members': [ERROR, 'always', { exceptAfterSingleLine: false }],
|
|
78
|
+
'@stylistic/max-len': [ERROR, MAX_LEN],
|
|
79
|
+
'@stylistic/max-statements-per-line': [OFF],
|
|
80
|
+
'@stylistic/multiline-ternary': [ERROR, 'always-multiline'],
|
|
81
|
+
'@stylistic/new-parens': [ERROR, 'always'],
|
|
82
|
+
'@stylistic/newline-per-chained-call': [ERROR, { ignoreChainWithDepth: 2 }],
|
|
83
|
+
'@stylistic/no-confusing-arrow': [ERROR, { allowParens: true }],
|
|
84
|
+
'@stylistic/no-extra-parens': [OFF],
|
|
85
|
+
'@stylistic/no-extra-semi': [ERROR],
|
|
86
|
+
'@stylistic/no-floating-decimal': [ERROR],
|
|
87
|
+
'@stylistic/no-mixed-operators': [OFF, { allowSamePrecedence: true }],
|
|
88
|
+
'@stylistic/no-mixed-spaces-and-tabs': [ERROR],
|
|
89
|
+
'@stylistic/no-multi-spaces': [ERROR, { ignoreEOLComments: false }],
|
|
90
|
+
'@stylistic/no-multiple-empty-lines': [ERROR, {
|
|
91
|
+
max: 2,
|
|
92
|
+
maxBOF: 0,
|
|
93
|
+
maxEOF: 0,
|
|
94
|
+
}],
|
|
95
|
+
'@stylistic/no-tabs': [ERROR],
|
|
96
|
+
'@stylistic/no-trailing-spaces': [ERROR, {
|
|
97
|
+
skipBlankLines: false,
|
|
98
|
+
ignoreComments: false,
|
|
99
|
+
}],
|
|
100
|
+
'@stylistic/no-whitespace-before-property': [ERROR],
|
|
101
|
+
'@stylistic/nonblock-statement-body-position': [ERROR, 'beside'],
|
|
102
|
+
'@stylistic/object-curly-newline': [ERROR, {
|
|
103
|
+
ObjectExpression: {
|
|
104
|
+
minProperties: 4,
|
|
105
|
+
multiline: true,
|
|
106
|
+
consistent: true,
|
|
107
|
+
},
|
|
108
|
+
ObjectPattern: {
|
|
109
|
+
minProperties: 4,
|
|
110
|
+
multiline: true,
|
|
111
|
+
consistent: true,
|
|
112
|
+
},
|
|
113
|
+
ImportDeclaration: {
|
|
114
|
+
minProperties: 4,
|
|
115
|
+
multiline: true,
|
|
116
|
+
consistent: true,
|
|
117
|
+
},
|
|
118
|
+
ExportDeclaration: {
|
|
119
|
+
minProperties: 4,
|
|
120
|
+
multiline: true,
|
|
121
|
+
consistent: true,
|
|
122
|
+
},
|
|
123
|
+
}],
|
|
124
|
+
'@stylistic/object-curly-spacing': [ERROR, 'always'],
|
|
125
|
+
'@stylistic/object-property-newline': [ERROR, { allowAllPropertiesOnSameLine: true }],
|
|
126
|
+
'@stylistic/one-var-declaration-per-line': [ERROR, 'always'],
|
|
127
|
+
'@stylistic/operator-linebreak': [ERROR, 'before', { overrides: { '=': 'none' } }],
|
|
128
|
+
'@stylistic/padded-blocks': [ERROR,
|
|
129
|
+
{
|
|
130
|
+
blocks: 'never',
|
|
131
|
+
classes: 'never',
|
|
132
|
+
switches: 'never',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
allowSingleLineBlocks: false,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
'@stylistic/padding-line-between-statements': [OFF],
|
|
139
|
+
'@stylistic/quote-props': [ERROR, 'consistent-as-needed'],
|
|
140
|
+
'@stylistic/quotes': [ERROR, 'single', { avoidEscape: true }],
|
|
141
|
+
'@stylistic/rest-spread-spacing': [ERROR, 'never'],
|
|
142
|
+
'@stylistic/semi': [ERROR, 'always'],
|
|
143
|
+
'@stylistic/semi-spacing': [ERROR, { before: false, after: true }],
|
|
144
|
+
'@stylistic/semi-style': [ERROR, 'last'],
|
|
145
|
+
'@stylistic/space-before-blocks': [ERROR, 'always'],
|
|
146
|
+
'@stylistic/space-before-function-paren': [ERROR, {
|
|
147
|
+
anonymous: 'always',
|
|
148
|
+
named: 'never',
|
|
149
|
+
asyncArrow: 'always',
|
|
150
|
+
}],
|
|
151
|
+
'@stylistic/space-in-parens': [ERROR, 'never'],
|
|
152
|
+
'@stylistic/space-infix-ops': [ERROR],
|
|
153
|
+
'@stylistic/space-unary-ops': [ERROR, {
|
|
154
|
+
words: true,
|
|
155
|
+
nonwords: false,
|
|
156
|
+
}],
|
|
157
|
+
'@stylistic/spaced-comment': [ERROR, 'always', {
|
|
158
|
+
line: {
|
|
159
|
+
exceptions: ['-', '+'],
|
|
160
|
+
},
|
|
161
|
+
block: {
|
|
162
|
+
exceptions: ['-', '+'],
|
|
163
|
+
balanced: true,
|
|
164
|
+
},
|
|
165
|
+
}],
|
|
166
|
+
'@stylistic/switch-colon-spacing': [ERROR, { after: true, before: false }],
|
|
167
|
+
'@stylistic/template-curly-spacing': [ERROR, 'never'],
|
|
168
|
+
'@stylistic/template-tag-spacing': [ERROR, 'never'],
|
|
169
|
+
'@stylistic/wrap-iife': [ERROR, 'outside', { functionPrototypeMethods: false }],
|
|
170
|
+
'@stylistic/wrap-regex': [ERROR],
|
|
171
|
+
'@stylistic/yield-star-spacing': [ERROR, 'after'],
|
|
172
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ERROR } from '../severity.js';
|
|
2
|
+
|
|
3
|
+
/* == formatting rules for typescript == */
|
|
4
|
+
export default {
|
|
5
|
+
'@stylistic/member-delimiter-style': [ERROR],
|
|
6
|
+
'@stylistic/type-annotation-spacing': [ERROR],
|
|
7
|
+
'@stylistic/type-generic-spacing': [ERROR],
|
|
8
|
+
'@stylistic/type-named-tuple-spacing': [ERROR],
|
|
9
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ERROR, OFF, WARN } from '../severity.js';
|
|
2
|
+
|
|
3
|
+
export const commonRules = {
|
|
4
|
+
'@typescript-eslint/adjacent-overload-signatures': ERROR,
|
|
5
|
+
'@typescript-eslint/array-type': ERROR,
|
|
6
|
+
'@typescript-eslint/await-thenable': ERROR,
|
|
7
|
+
'@typescript-eslint/ban-ts-comment': ERROR,
|
|
8
|
+
'@typescript-eslint/ban-tslint-comment': ERROR,
|
|
9
|
+
// '@typescript-eslint/ban-types': ERROR,
|
|
10
|
+
'@typescript-eslint/class-literal-property-style': ERROR,
|
|
11
|
+
'@typescript-eslint/consistent-generic-constructors': ERROR,
|
|
12
|
+
'@typescript-eslint/consistent-indexed-object-style': ERROR,
|
|
13
|
+
'@typescript-eslint/consistent-type-assertions': ERROR,
|
|
14
|
+
'@typescript-eslint/consistent-type-definitions': ERROR,
|
|
15
|
+
'@typescript-eslint/consistent-type-exports': ERROR,
|
|
16
|
+
'@typescript-eslint/consistent-type-imports': ERROR,
|
|
17
|
+
'@typescript-eslint/explicit-function-return-type': OFF,
|
|
18
|
+
'@typescript-eslint/explicit-member-accessibility': ERROR,
|
|
19
|
+
'@typescript-eslint/explicit-module-boundary-types': OFF,
|
|
20
|
+
// '@typescript-eslint/member-delimiter-style': ERROR,
|
|
21
|
+
'@typescript-eslint/member-ordering': ERROR,
|
|
22
|
+
'@typescript-eslint/method-signature-style': ERROR,
|
|
23
|
+
'@typescript-eslint/naming-convention': [
|
|
24
|
+
ERROR,
|
|
25
|
+
{
|
|
26
|
+
selector: 'default',
|
|
27
|
+
// UPPER_CASE for, like example, consts from env files
|
|
28
|
+
format: ['camelCase', 'UPPER_CASE'],
|
|
29
|
+
leadingUnderscore: 'forbid',
|
|
30
|
+
trailingUnderscore: 'forbid',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
selector: 'import',
|
|
34
|
+
// PascalCase for components import
|
|
35
|
+
format: ['camelCase', 'PascalCase'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
selector: 'variable',
|
|
39
|
+
// UPPER_CASE for, like example, consts from env files
|
|
40
|
+
format: ['camelCase', 'UPPER_CASE'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
selector: 'typeLike',
|
|
44
|
+
format: ['PascalCase'],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
selector: 'objectLiteralProperty',
|
|
48
|
+
// because of BE inconsistency
|
|
49
|
+
format: null,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'@typescript-eslint/no-base-to-string': ERROR,
|
|
53
|
+
'@typescript-eslint/no-confusing-non-null-assertion': ERROR,
|
|
54
|
+
'@typescript-eslint/no-confusing-void-expression': ERROR,
|
|
55
|
+
'@typescript-eslint/no-duplicate-enum-values': ERROR,
|
|
56
|
+
'@typescript-eslint/no-duplicate-type-constituents': ERROR,
|
|
57
|
+
'@typescript-eslint/no-dynamic-delete': ERROR,
|
|
58
|
+
'@typescript-eslint/no-empty-interface': ERROR,
|
|
59
|
+
'@typescript-eslint/no-explicit-any': WARN,
|
|
60
|
+
'@typescript-eslint/no-extra-non-null-assertion': ERROR,
|
|
61
|
+
'@typescript-eslint/no-extraneous-class': ERROR,
|
|
62
|
+
'@typescript-eslint/no-floating-promises': ERROR,
|
|
63
|
+
'@typescript-eslint/no-for-in-array': ERROR,
|
|
64
|
+
'@typescript-eslint/no-import-type-side-effects': ERROR,
|
|
65
|
+
'@typescript-eslint/no-inferrable-types': ERROR,
|
|
66
|
+
'@typescript-eslint/no-invalid-void-type': ERROR,
|
|
67
|
+
'@typescript-eslint/no-meaningless-void-operator': ERROR,
|
|
68
|
+
'@typescript-eslint/no-misused-new': ERROR,
|
|
69
|
+
'@typescript-eslint/no-misused-promises': [
|
|
70
|
+
ERROR,
|
|
71
|
+
{
|
|
72
|
+
checksVoidReturn: false,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
'@typescript-eslint/no-mixed-enums': ERROR,
|
|
76
|
+
'@typescript-eslint/no-namespace': ERROR,
|
|
77
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': ERROR,
|
|
78
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': ERROR,
|
|
79
|
+
'@typescript-eslint/no-non-null-assertion': OFF,
|
|
80
|
+
'@typescript-eslint/no-redundant-type-constituents': ERROR,
|
|
81
|
+
'@typescript-eslint/no-require-imports': ERROR,
|
|
82
|
+
'@typescript-eslint/no-this-alias': ERROR,
|
|
83
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': ERROR,
|
|
84
|
+
'@typescript-eslint/no-unnecessary-condition': ERROR,
|
|
85
|
+
'@typescript-eslint/no-unnecessary-qualifier': ERROR,
|
|
86
|
+
'@typescript-eslint/no-unnecessary-type-arguments': ERROR,
|
|
87
|
+
'@typescript-eslint/no-unnecessary-type-assertion': ERROR,
|
|
88
|
+
'@typescript-eslint/no-unnecessary-type-constraint': ERROR,
|
|
89
|
+
'@typescript-eslint/no-unsafe-argument': WARN,
|
|
90
|
+
'@typescript-eslint/no-unsafe-assignment': OFF,
|
|
91
|
+
'@typescript-eslint/no-unsafe-call': WARN,
|
|
92
|
+
'@typescript-eslint/no-unsafe-declaration-merging': ERROR,
|
|
93
|
+
'@typescript-eslint/no-unsafe-enum-comparison': ERROR,
|
|
94
|
+
'@typescript-eslint/no-unsafe-member-access': WARN,
|
|
95
|
+
'@typescript-eslint/no-unsafe-return': OFF,
|
|
96
|
+
'@typescript-eslint/no-useless-empty-export': ERROR,
|
|
97
|
+
'@typescript-eslint/no-var-requires': ERROR,
|
|
98
|
+
'@typescript-eslint/non-nullable-type-assertion-style': ERROR,
|
|
99
|
+
'@typescript-eslint/parameter-properties': ERROR,
|
|
100
|
+
'@typescript-eslint/prefer-as-const': ERROR,
|
|
101
|
+
'@typescript-eslint/prefer-enum-initializers': ERROR,
|
|
102
|
+
'@typescript-eslint/prefer-for-of': ERROR,
|
|
103
|
+
'@typescript-eslint/prefer-function-type': ERROR,
|
|
104
|
+
'@typescript-eslint/prefer-includes': ERROR,
|
|
105
|
+
'@typescript-eslint/prefer-literal-enum-member': ERROR,
|
|
106
|
+
'@typescript-eslint/prefer-namespace-keyword': ERROR,
|
|
107
|
+
// maybe we will enable it later, after ending discuss in ts-eslint repo
|
|
108
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue%20state%3Aopen%20prefer-nullish-coalescing
|
|
109
|
+
'@typescript-eslint/prefer-nullish-coalescing': OFF,
|
|
110
|
+
'@typescript-eslint/prefer-optional-chain': ERROR,
|
|
111
|
+
'@typescript-eslint/prefer-readonly': ERROR,
|
|
112
|
+
'@typescript-eslint/prefer-readonly-parameter-types': OFF,
|
|
113
|
+
'@typescript-eslint/prefer-reduce-type-parameter': ERROR,
|
|
114
|
+
'@typescript-eslint/prefer-regexp-exec': ERROR,
|
|
115
|
+
'@typescript-eslint/prefer-return-this-type': ERROR,
|
|
116
|
+
'@typescript-eslint/prefer-string-starts-ends-with': ERROR,
|
|
117
|
+
'@typescript-eslint/prefer-ts-expect-error': ERROR,
|
|
118
|
+
'@typescript-eslint/promise-function-async': ERROR,
|
|
119
|
+
'@typescript-eslint/require-array-sort-compare': ERROR,
|
|
120
|
+
'@typescript-eslint/restrict-plus-operands': ERROR,
|
|
121
|
+
'@typescript-eslint/restrict-template-expressions': ERROR,
|
|
122
|
+
'@typescript-eslint/sort-type-constituents': OFF,
|
|
123
|
+
'@typescript-eslint/strict-boolean-expressions': OFF,
|
|
124
|
+
'@typescript-eslint/switch-exhaustiveness-check': OFF,
|
|
125
|
+
'@typescript-eslint/triple-slash-reference': ERROR,
|
|
126
|
+
// '@typescript-eslint/type-annotation-spacing': ERROR,
|
|
127
|
+
'@typescript-eslint/typedef': ERROR,
|
|
128
|
+
'@typescript-eslint/unbound-method': ERROR,
|
|
129
|
+
'@typescript-eslint/unified-signatures': ERROR,
|
|
130
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ERROR, OFF } from '../severity.js';
|
|
2
|
+
|
|
3
|
+
export const compatibilityRules = {
|
|
4
|
+
'constructor-super': OFF, // ts(2335) & ts(2377)
|
|
5
|
+
'getter-return': OFF, // ts(2378)
|
|
6
|
+
'no-const-assign': OFF, // ts(2588)
|
|
7
|
+
'no-dupe-args': OFF, // ts(2300)
|
|
8
|
+
'no-dupe-class-members': OFF, // ts(2393) & ts(2300)
|
|
9
|
+
'no-dupe-keys': OFF, // ts(1117)
|
|
10
|
+
'no-func-assign': OFF, // ts(2630)
|
|
11
|
+
'no-import-assign': OFF, // ts(2632) & ts(2540)
|
|
12
|
+
'no-new-symbol': OFF, // ts(7009)
|
|
13
|
+
'no-obj-calls': OFF, // ts(2349)
|
|
14
|
+
'no-redeclare': OFF, // ts(2451)
|
|
15
|
+
'no-setter-return': OFF, // ts(2408)
|
|
16
|
+
'no-this-before-super': OFF, // ts(2376) & ts(17009)
|
|
17
|
+
'no-undef': OFF, // ts(2304) & ts(2552)
|
|
18
|
+
'no-unreachable': OFF, // ts(7027)
|
|
19
|
+
'no-unsafe-negation': OFF, // ts(2365) & ts(2322) & ts(2358)
|
|
20
|
+
'no-var': ERROR, // ts transpiles let/const to var, so no need for vars anymore
|
|
21
|
+
'prefer-const': ERROR, // ts provides better types with const
|
|
22
|
+
'prefer-rest-params': ERROR, // ts provides better types with rest args over arguments
|
|
23
|
+
'prefer-spread': ERROR, // ts transpiles spread to apply, so no need for manual apply
|
|
24
|
+
};
|