@perfective/eslint-config 0.31.2 → 0.32.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/README.adoc +2 -2
- package/README.md +2 -2
- package/config/eslint/possible-problems-rules.js +2 -1
- package/config/eslint/suggestions-rules.js +1 -1
- package/config/import/import-config.js +2 -2
- package/config/import/static-analysis-rules.js +1 -0
- package/config/jest/jest-config.js +1 -0
- package/config/node/node-config.js +1 -0
- package/config/perfective-eslint-config.js +2 -5
- package/config/stylistic/stylistic-config.d.ts +2 -0
- package/config/stylistic/stylistic-config.js +298 -0
- package/config/testing-library/testing-library-config.js +1 -0
- package/config/typescript-eslint/extension-rules.js +1 -0
- package/config/typescript-eslint/supported-rules.js +5 -2
- package/config/unicorn/unicorn-config.js +4 -0
- package/package.json +12 -16
- package/config/stylistic/js/stylistic-js-config.d.ts +0 -2
- package/config/stylistic/js/stylistic-js-config.js +0 -200
- package/config/stylistic/jsx/stylistic-jsx-config.d.ts +0 -2
- package/config/stylistic/jsx/stylistic-jsx-config.js +0 -87
- package/config/stylistic/plus/stylistic-plus-config.d.ts +0 -2
- package/config/stylistic/plus/stylistic-plus-config.js +0 -16
- package/config/stylistic/ts/stylistic-ts-config.d.ts +0 -2
- package/config/stylistic/ts/stylistic-ts-config.js +0 -141
package/README.adoc
CHANGED
|
@@ -105,14 +105,14 @@ const eslintConfig = perfectiveEslintConfig([
|
|
|
105
105
|
{
|
|
106
106
|
// These rules are overridden to all files
|
|
107
107
|
rules: {
|
|
108
|
-
'@stylistic/
|
|
108
|
+
'@stylistic/indent': ['warn', 2],
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
// These rules are overridden to TypeScript files only
|
|
113
113
|
files: typescriptFiles,
|
|
114
114
|
rules: {
|
|
115
|
-
'@stylistic/
|
|
115
|
+
'@stylistic/indent': ['warn', 4],
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
118
|
]);
|
package/README.md
CHANGED
|
@@ -100,14 +100,14 @@ you need to use `eslint.config.mjs` file instead of `eslint.config.js` to run it
|
|
|
100
100
|
{
|
|
101
101
|
// These rules are overridden to all files
|
|
102
102
|
rules: {
|
|
103
|
-
'@stylistic/
|
|
103
|
+
'@stylistic/indent': ['warn', 2],
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
// These rules are overridden to TypeScript files only
|
|
108
108
|
files: typescriptFiles,
|
|
109
109
|
rules: {
|
|
110
|
-
'@stylistic/
|
|
110
|
+
'@stylistic/indent': ['warn', 4],
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
113
|
]);
|
|
@@ -59,6 +59,7 @@ export const eslintPossibleProblemsRules = {
|
|
|
59
59
|
'no-sparse-arrays': 'error',
|
|
60
60
|
'no-template-curly-in-string': 'error',
|
|
61
61
|
'no-this-before-super': 'error',
|
|
62
|
+
'no-unassigned-vars': 'error',
|
|
62
63
|
'no-undef': 'off',
|
|
63
64
|
'no-unexpected-multiline': 'error',
|
|
64
65
|
'no-unmodified-loop-condition': 'error',
|
|
@@ -84,8 +85,8 @@ export const eslintPossibleProblemsRules = {
|
|
|
84
85
|
variables: false,
|
|
85
86
|
allowNamedExports: false
|
|
86
87
|
}],
|
|
87
|
-
'no-useless-backreference': 'error',
|
|
88
88
|
'no-useless-assignment': 'error',
|
|
89
|
+
'no-useless-backreference': 'error',
|
|
89
90
|
'require-atomic-updates': ['error', {
|
|
90
91
|
allowProperties: false
|
|
91
92
|
}],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import eslintPluginImport from 'eslint-plugin-import';
|
|
2
2
|
import { javascriptFiles, typescriptFiles } from "../../linter/glob.js";
|
|
3
3
|
import { javascriptLanguageOptions, typescriptLanguageOptions } from "../../linter/language-options.js";
|
|
4
4
|
import { helpfulWarningsRules } from "./helpful-warnings-rules.js";
|
|
@@ -8,7 +8,7 @@ import { styleGuideRules } from "./style-guide-rules.js";
|
|
|
8
8
|
export function importConfig() {
|
|
9
9
|
return {
|
|
10
10
|
plugins: {
|
|
11
|
-
import:
|
|
11
|
+
import: eslintPluginImport
|
|
12
12
|
},
|
|
13
13
|
rules: Object.assign(Object.assign(Object.assign(Object.assign({}, staticAnalysisRules), helpfulWarningsRules), moduleSystemsRules), styleGuideRules)
|
|
14
14
|
};
|
|
@@ -65,6 +65,7 @@ export function jestConfig(files = jestFiles) {
|
|
|
65
65
|
'jest/prefer-called-with': 'error',
|
|
66
66
|
'jest/prefer-comparison-matcher': 'warn',
|
|
67
67
|
'jest/prefer-each': 'error',
|
|
68
|
+
'jest/prefer-ending-with-an-expect': 'error',
|
|
68
69
|
'jest/prefer-equality-matcher': 'error',
|
|
69
70
|
'jest/prefer-expect-assertions': 'off',
|
|
70
71
|
'jest/prefer-expect-resolves': 'warn',
|
|
@@ -12,10 +12,7 @@ import { preferArrowConfig } from "./prefer-arrow/prefer-arrow-config.js";
|
|
|
12
12
|
import { promiseConfig } from "./promise/promise-config.js";
|
|
13
13
|
import { securityConfig } from "./security/security-config.js";
|
|
14
14
|
import { simpleImportSortConfig } from "./simple-import-sort/simple-import-sort-config.js";
|
|
15
|
-
import {
|
|
16
|
-
import { stylisticJsxConfig } from "./stylistic/jsx/stylistic-jsx-config.js";
|
|
17
|
-
import { stylisticPlusConfig } from "./stylistic/plus/stylistic-plus-config.js";
|
|
18
|
-
import { stylisticTsConfig } from "./stylistic/ts/stylistic-ts-config.js";
|
|
15
|
+
import { stylisticConfig } from "./stylistic/stylistic-config.js";
|
|
19
16
|
import { typescriptEslintConfig } from "./typescript-eslint/typescript-eslint-config.js";
|
|
20
17
|
import { unicornConfig } from "./unicorn/unicorn-config.js";
|
|
21
18
|
export function perfectiveEslintConfig(configs = []) {
|
|
@@ -23,7 +20,7 @@ export function perfectiveEslintConfig(configs = []) {
|
|
|
23
20
|
languageOptions: languageOptions()
|
|
24
21
|
}, {
|
|
25
22
|
ignores: ['**/dist', typescriptDeclarationFiles]
|
|
26
|
-
}, eslintConfig(), typescriptEslintConfig(), arrayFuncConfig(), eslintCommentsConfig(), importConfig(), importJavascriptConfig(), importTypescriptConfig(), jsdocConfig(), jsdocJavascriptConfig(), nodeConfig(), preferArrowConfig(), promiseConfig(), securityConfig(), simpleImportSortConfig(),
|
|
23
|
+
}, eslintConfig(), typescriptEslintConfig(), arrayFuncConfig(), eslintCommentsConfig(), importConfig(), importJavascriptConfig(), importTypescriptConfig(), jsdocConfig(), jsdocJavascriptConfig(), nodeConfig(), preferArrowConfig(), promiseConfig(), securityConfig(), simpleImportSortConfig(), stylisticConfig(), unicornConfig(), configurationFilesConfig()].concat(configs.map(linterConfig));
|
|
27
24
|
}
|
|
28
25
|
function configurationFilesConfig() {
|
|
29
26
|
return {
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import eslintPluginStylistic from '@stylistic/eslint-plugin';
|
|
2
|
+
export function stylisticConfig() {
|
|
3
|
+
return {
|
|
4
|
+
plugins: {
|
|
5
|
+
'@stylistic': eslintPluginStylistic
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'@stylistic/array-bracket-newline': ['warn', 'consistent'],
|
|
9
|
+
'@stylistic/array-bracket-spacing': ['warn', 'never'],
|
|
10
|
+
'@stylistic/array-element-newline': ['warn', 'consistent'],
|
|
11
|
+
'@stylistic/arrow-parens': ['warn', 'as-needed'],
|
|
12
|
+
'@stylistic/arrow-spacing': ['warn', {
|
|
13
|
+
before: true,
|
|
14
|
+
after: true
|
|
15
|
+
}],
|
|
16
|
+
'@stylistic/block-spacing': ['warn', 'always'],
|
|
17
|
+
'@stylistic/brace-style': ['warn', 'stroustrup', {
|
|
18
|
+
allowSingleLine: false
|
|
19
|
+
}],
|
|
20
|
+
'@stylistic/comma-dangle': ['warn', {
|
|
21
|
+
arrays: 'always-multiline',
|
|
22
|
+
enums: 'always-multiline',
|
|
23
|
+
exports: 'always-multiline',
|
|
24
|
+
functions: 'always-multiline',
|
|
25
|
+
generics: 'always-multiline',
|
|
26
|
+
imports: 'always-multiline',
|
|
27
|
+
objects: 'always-multiline',
|
|
28
|
+
tuples: 'always-multiline'
|
|
29
|
+
}],
|
|
30
|
+
'@stylistic/comma-spacing': ['warn', {
|
|
31
|
+
before: false,
|
|
32
|
+
after: true
|
|
33
|
+
}],
|
|
34
|
+
'@stylistic/comma-style': ['warn', 'last'],
|
|
35
|
+
'@stylistic/computed-property-spacing': ['warn', 'never'],
|
|
36
|
+
'@stylistic/curly-newline': ['warn', {
|
|
37
|
+
minElements: 1
|
|
38
|
+
}],
|
|
39
|
+
'@stylistic/dot-location': ['warn', 'property'],
|
|
40
|
+
'@stylistic/eol-last': ['warn', 'always'],
|
|
41
|
+
'@stylistic/function-call-argument-newline': ['warn', 'consistent'],
|
|
42
|
+
'@stylistic/function-call-spacing': ['warn', 'never'],
|
|
43
|
+
'@stylistic/function-paren-newline': ['warn', 'consistent'],
|
|
44
|
+
'@stylistic/generator-star-spacing': ['warn', {
|
|
45
|
+
before: true,
|
|
46
|
+
after: false
|
|
47
|
+
}],
|
|
48
|
+
'@stylistic/implicit-arrow-linebreak': ['warn', 'beside'],
|
|
49
|
+
'@stylistic/indent': ['warn', 4, {
|
|
50
|
+
SwitchCase: 1,
|
|
51
|
+
ignoredNodes: ['TSTypeParameterInstantiation']
|
|
52
|
+
}],
|
|
53
|
+
'@stylistic/indent-binary-ops': ['warn', 4],
|
|
54
|
+
'@stylistic/jsx-child-element-spacing': 'error',
|
|
55
|
+
'@stylistic/jsx-closing-bracket-location': ['warn', {
|
|
56
|
+
selfClosing: 'after-props',
|
|
57
|
+
nonEmpty: 'after-props'
|
|
58
|
+
}],
|
|
59
|
+
'@stylistic/jsx-closing-tag-location': ['warn', 'tag-aligned'],
|
|
60
|
+
'@stylistic/jsx-curly-brace-presence': ['warn', {
|
|
61
|
+
props: 'never',
|
|
62
|
+
children: 'always',
|
|
63
|
+
propElementValues: 'always'
|
|
64
|
+
}],
|
|
65
|
+
'@stylistic/jsx-curly-newline': ['warn', 'never'],
|
|
66
|
+
'@stylistic/jsx-curly-spacing': ['warn', {
|
|
67
|
+
when: 'never',
|
|
68
|
+
attributes: {
|
|
69
|
+
allowMultiline: false
|
|
70
|
+
},
|
|
71
|
+
children: {
|
|
72
|
+
allowMultiline: false
|
|
73
|
+
}
|
|
74
|
+
}],
|
|
75
|
+
'@stylistic/jsx-equals-spacing': ['warn', 'never'],
|
|
76
|
+
'@stylistic/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
|
|
77
|
+
'@stylistic/jsx-function-call-newline': ['warn', 'multiline'],
|
|
78
|
+
'@stylistic/jsx-indent': 'off',
|
|
79
|
+
'@stylistic/jsx-indent-props': ['warn', {
|
|
80
|
+
indentMode: 1,
|
|
81
|
+
ignoreTernaryOperator: false
|
|
82
|
+
}],
|
|
83
|
+
'@stylistic/jsx-max-props-per-line': ['warn', {
|
|
84
|
+
maximum: 1,
|
|
85
|
+
when: 'always'
|
|
86
|
+
}],
|
|
87
|
+
'@stylistic/jsx-newline': 'off',
|
|
88
|
+
'@stylistic/jsx-one-expression-per-line': ['warn', {
|
|
89
|
+
allow: 'single-child'
|
|
90
|
+
}],
|
|
91
|
+
'@stylistic/jsx-pascal-case': ['error', {
|
|
92
|
+
allowAllCaps: false,
|
|
93
|
+
allowLeadingUnderscore: false,
|
|
94
|
+
allowNamespace: false,
|
|
95
|
+
ignore: []
|
|
96
|
+
}],
|
|
97
|
+
'@stylistic/jsx-props-no-multi-spaces': 'warn',
|
|
98
|
+
'@stylistic/jsx-quotes': ['warn', 'prefer-double'],
|
|
99
|
+
'@stylistic/jsx-self-closing-comp': ['warn', {
|
|
100
|
+
component: true,
|
|
101
|
+
html: true
|
|
102
|
+
}],
|
|
103
|
+
'@stylistic/jsx-sort-props': ['warn', {
|
|
104
|
+
ignoreCase: false,
|
|
105
|
+
callbacksLast: true,
|
|
106
|
+
shorthandFirst: true,
|
|
107
|
+
shorthandLast: false,
|
|
108
|
+
multiline: 'ignore',
|
|
109
|
+
noSortAlphabetically: false,
|
|
110
|
+
reservedFirst: true,
|
|
111
|
+
locale: 'auto'
|
|
112
|
+
}],
|
|
113
|
+
'@stylistic/jsx-tag-spacing': ['warn', {
|
|
114
|
+
closingSlash: 'never',
|
|
115
|
+
beforeSelfClosing: 'always',
|
|
116
|
+
afterOpening: 'never',
|
|
117
|
+
beforeClosing: 'never'
|
|
118
|
+
}],
|
|
119
|
+
'@stylistic/jsx-wrap-multilines': ['warn', {
|
|
120
|
+
declaration: 'parens-new-line',
|
|
121
|
+
assignment: 'parens-new-line',
|
|
122
|
+
return: 'parens-new-line',
|
|
123
|
+
arrow: 'parens-new-line',
|
|
124
|
+
condition: 'parens-new-line',
|
|
125
|
+
logical: 'parens-new-line',
|
|
126
|
+
prop: 'parens-new-line'
|
|
127
|
+
}],
|
|
128
|
+
'@stylistic/key-spacing': ['warn', {
|
|
129
|
+
beforeColon: false,
|
|
130
|
+
afterColon: true,
|
|
131
|
+
mode: 'strict'
|
|
132
|
+
}],
|
|
133
|
+
'@stylistic/keyword-spacing': ['warn', {
|
|
134
|
+
before: true,
|
|
135
|
+
after: true
|
|
136
|
+
}],
|
|
137
|
+
'@stylistic/line-comment-position': ['error', {
|
|
138
|
+
position: 'above',
|
|
139
|
+
ignorePattern: '^ == .+'
|
|
140
|
+
}],
|
|
141
|
+
'@stylistic/linebreak-style': ['warn', 'unix'],
|
|
142
|
+
'@stylistic/lines-around-comment': ['warn', {
|
|
143
|
+
beforeBlockComment: true,
|
|
144
|
+
afterBlockComment: false,
|
|
145
|
+
beforeLineComment: false,
|
|
146
|
+
afterLineComment: false,
|
|
147
|
+
allowBlockStart: false,
|
|
148
|
+
allowBlockEnd: false,
|
|
149
|
+
allowObjectStart: false,
|
|
150
|
+
allowObjectEnd: false,
|
|
151
|
+
allowArrayStart: false,
|
|
152
|
+
allowArrayEnd: false,
|
|
153
|
+
allowClassStart: true,
|
|
154
|
+
allowClassEnd: false,
|
|
155
|
+
allowInterfaceStart: true,
|
|
156
|
+
allowInterfaceEnd: true,
|
|
157
|
+
allowTypeStart: true,
|
|
158
|
+
allowTypeEnd: true
|
|
159
|
+
}],
|
|
160
|
+
'@stylistic/lines-between-class-members': ['warn', 'always', {
|
|
161
|
+
exceptAfterSingleLine: true,
|
|
162
|
+
exceptAfterOverload: true
|
|
163
|
+
}],
|
|
164
|
+
'@stylistic/max-len': ['error', {
|
|
165
|
+
code: 120,
|
|
166
|
+
tabWidth: 4,
|
|
167
|
+
ignoreRegExpLiterals: true,
|
|
168
|
+
ignoreUrls: true
|
|
169
|
+
}],
|
|
170
|
+
'@stylistic/max-statements-per-line': ['error', {
|
|
171
|
+
max: 1
|
|
172
|
+
}],
|
|
173
|
+
'@stylistic/member-delimiter-style': ['warn', {
|
|
174
|
+
multiline: {
|
|
175
|
+
delimiter: 'semi',
|
|
176
|
+
requireLast: true
|
|
177
|
+
},
|
|
178
|
+
singleline: {
|
|
179
|
+
delimiter: 'semi',
|
|
180
|
+
requireLast: true
|
|
181
|
+
},
|
|
182
|
+
multilineDetection: 'brackets'
|
|
183
|
+
}],
|
|
184
|
+
'@stylistic/multiline-comment-style': ['warn', 'separate-lines', {
|
|
185
|
+
checkJSDoc: false
|
|
186
|
+
}],
|
|
187
|
+
'@stylistic/multiline-ternary': ['warn', 'always-multiline'],
|
|
188
|
+
'@stylistic/new-parens': 'warn',
|
|
189
|
+
'@stylistic/newline-per-chained-call': ['off', {
|
|
190
|
+
ignoreChainWithDepth: 3
|
|
191
|
+
}],
|
|
192
|
+
'@stylistic/no-confusing-arrow': ['warn', {
|
|
193
|
+
allowParens: true,
|
|
194
|
+
onlyOneSimpleParam: false
|
|
195
|
+
}],
|
|
196
|
+
'@stylistic/no-extra-parens': ['warn', 'all', {
|
|
197
|
+
ignoreJSX: 'all',
|
|
198
|
+
nestedBinaryExpressions: false,
|
|
199
|
+
nestedConditionalExpressions: false,
|
|
200
|
+
enforceForArrowConditionals: false,
|
|
201
|
+
ternaryOperandBinaryExpressions: false
|
|
202
|
+
}],
|
|
203
|
+
'@stylistic/no-extra-semi': 'warn',
|
|
204
|
+
'@stylistic/no-floating-decimal': 'warn',
|
|
205
|
+
'@stylistic/no-mixed-operators': ['error', {
|
|
206
|
+
groups: [['+', '-'], ['*', '/', '%', '**'], ['&', '|', '^', '~', '<<', '>>', '>>>'], ['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['&&', '||', '?:', '??'], ['in', 'instanceof']],
|
|
207
|
+
allowSamePrecedence: true
|
|
208
|
+
}],
|
|
209
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
210
|
+
'@stylistic/no-multi-spaces': 'warn',
|
|
211
|
+
'@stylistic/no-multiple-empty-lines': ['warn', {
|
|
212
|
+
max: 1,
|
|
213
|
+
maxEOF: 0,
|
|
214
|
+
maxBOF: 0
|
|
215
|
+
}],
|
|
216
|
+
'@stylistic/no-tabs': 'error',
|
|
217
|
+
'@stylistic/no-trailing-spaces': 'warn',
|
|
218
|
+
'@stylistic/no-whitespace-before-property': 'warn',
|
|
219
|
+
'@stylistic/nonblock-statement-body-position': ['warn', 'below'],
|
|
220
|
+
'@stylistic/object-curly-newline': ['warn', {
|
|
221
|
+
ImportDeclaration: {
|
|
222
|
+
multiline: true
|
|
223
|
+
},
|
|
224
|
+
ExportDeclaration: {
|
|
225
|
+
multiline: true
|
|
226
|
+
}
|
|
227
|
+
}],
|
|
228
|
+
'@stylistic/object-curly-spacing': ['warn', 'always', {
|
|
229
|
+
arraysInObjects: true,
|
|
230
|
+
objectsInObjects: true
|
|
231
|
+
}],
|
|
232
|
+
'@stylistic/object-property-newline': ['warn', {
|
|
233
|
+
allowAllPropertiesOnSameLine: true
|
|
234
|
+
}],
|
|
235
|
+
'@stylistic/one-var-declaration-per-line': ['warn', 'always'],
|
|
236
|
+
'@stylistic/operator-linebreak': ['warn', 'before', {
|
|
237
|
+
overrides: {
|
|
238
|
+
'=': 'none',
|
|
239
|
+
'==': 'none',
|
|
240
|
+
'!=': 'none',
|
|
241
|
+
'>=': 'none',
|
|
242
|
+
'<=': 'none',
|
|
243
|
+
'===': 'none',
|
|
244
|
+
'+=': 'none'
|
|
245
|
+
}
|
|
246
|
+
}],
|
|
247
|
+
'@stylistic/padded-blocks': ['warn', 'never'],
|
|
248
|
+
'@stylistic/padding-line-between-statements': 'off',
|
|
249
|
+
'@stylistic/quote-props': ['warn', 'consistent-as-needed'],
|
|
250
|
+
'@stylistic/quotes': ['warn', 'single', {
|
|
251
|
+
avoidEscape: true,
|
|
252
|
+
allowTemplateLiterals: 'always',
|
|
253
|
+
ignoreStringLiterals: false
|
|
254
|
+
}],
|
|
255
|
+
'@stylistic/rest-spread-spacing': ['warn', 'never'],
|
|
256
|
+
'@stylistic/semi': ['warn', 'always'],
|
|
257
|
+
'@stylistic/semi-spacing': ['warn', {
|
|
258
|
+
before: false,
|
|
259
|
+
after: true
|
|
260
|
+
}],
|
|
261
|
+
'@stylistic/semi-style': ['warn', 'last'],
|
|
262
|
+
'@stylistic/space-before-blocks': ['warn', 'always'],
|
|
263
|
+
'@stylistic/space-before-function-paren': ['warn', {
|
|
264
|
+
anonymous: 'always',
|
|
265
|
+
named: 'never',
|
|
266
|
+
asyncArrow: 'always'
|
|
267
|
+
}],
|
|
268
|
+
'@stylistic/space-in-parens': ['warn', 'never'],
|
|
269
|
+
'@stylistic/space-infix-ops': ['warn', {
|
|
270
|
+
int32Hint: false
|
|
271
|
+
}],
|
|
272
|
+
'@stylistic/space-unary-ops': ['warn', {
|
|
273
|
+
words: true,
|
|
274
|
+
nonwords: false
|
|
275
|
+
}],
|
|
276
|
+
'@stylistic/spaced-comment': ['warn', 'always', {
|
|
277
|
+
line: {
|
|
278
|
+
markers: ['/ <reference']
|
|
279
|
+
}
|
|
280
|
+
}],
|
|
281
|
+
'@stylistic/switch-colon-spacing': ['warn', {
|
|
282
|
+
after: true,
|
|
283
|
+
before: false
|
|
284
|
+
}],
|
|
285
|
+
'@stylistic/template-curly-spacing': ['warn', 'never'],
|
|
286
|
+
'@stylistic/template-tag-spacing': ['warn', 'never'],
|
|
287
|
+
'@stylistic/type-annotation-spacing': 'warn',
|
|
288
|
+
'@stylistic/type-generic-spacing': 'warn',
|
|
289
|
+
'@stylistic/type-named-tuple-spacing': 'warn',
|
|
290
|
+
'@stylistic/wrap-iife': ['warn', 'outside'],
|
|
291
|
+
'@stylistic/wrap-regex': 'warn',
|
|
292
|
+
'@stylistic/yield-star-spacing': ['warn', {
|
|
293
|
+
before: true,
|
|
294
|
+
after: false
|
|
295
|
+
}]
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
@@ -24,6 +24,7 @@ export function testingLibraryConfig(files = jestFiles) {
|
|
|
24
24
|
'testing-library/no-node-access': 'error',
|
|
25
25
|
'testing-library/no-promise-in-fire-event': 'error',
|
|
26
26
|
'testing-library/no-render-in-lifecycle': 'error',
|
|
27
|
+
'testing-library/no-test-id-queries': 'error',
|
|
27
28
|
'testing-library/no-unnecessary-act': 'off',
|
|
28
29
|
'testing-library/no-wait-for-multiple-assertions': 'error',
|
|
29
30
|
'testing-library/no-wait-for-side-effects': 'error',
|
|
@@ -44,7 +44,9 @@ export const supportedRules = {
|
|
|
44
44
|
'@typescript-eslint/method-signature-style': ['warn', 'property'],
|
|
45
45
|
'@typescript-eslint/naming-convention': ['error', ...typescriptEslintNamingConvention()],
|
|
46
46
|
'@typescript-eslint/no-array-delete': 'error',
|
|
47
|
-
'@typescript-eslint/no-base-to-string': 'error',
|
|
47
|
+
'@typescript-eslint/no-base-to-string': ['error', {
|
|
48
|
+
checkUnknown: true
|
|
49
|
+
}],
|
|
48
50
|
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
|
|
49
51
|
'@typescript-eslint/no-confusing-void-expression': ['warn', {
|
|
50
52
|
ignoreArrowShorthand: true,
|
|
@@ -134,7 +136,8 @@ export const supportedRules = {
|
|
|
134
136
|
checkLiteralConstAssertions: true,
|
|
135
137
|
typesToIgnore: []
|
|
136
138
|
}],
|
|
137
|
-
'@typescript-eslint/no-unnecessary-type-constraint': '
|
|
139
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
140
|
+
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
|
|
138
141
|
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
139
142
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
140
143
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
@@ -35,6 +35,7 @@ export function unicornConfig() {
|
|
|
35
35
|
'unicorn/no-array-for-each': 'off',
|
|
36
36
|
'unicorn/no-array-method-this-argument': 'warn',
|
|
37
37
|
'unicorn/no-array-reduce': 'off',
|
|
38
|
+
'unicorn/no-array-reverse': 'off',
|
|
38
39
|
'unicorn/no-await-expression-member': 'error',
|
|
39
40
|
'unicorn/no-await-in-promise-methods': 'error',
|
|
40
41
|
'unicorn/no-console-spaces': 'warn',
|
|
@@ -78,6 +79,7 @@ export function unicornConfig() {
|
|
|
78
79
|
'unicorn/no-unreadable-iife': 'error',
|
|
79
80
|
'unicorn/no-unsafe-regex': 'off',
|
|
80
81
|
'unicorn/no-unused-properties': 'off',
|
|
82
|
+
'unicorn/no-useless-error-capture-stack-trace': 'warn',
|
|
81
83
|
'unicorn/no-useless-fallback-in-spread': 'warn',
|
|
82
84
|
'unicorn/no-useless-length-check': 'warn',
|
|
83
85
|
'unicorn/no-useless-promise-resolve-reject': 'warn',
|
|
@@ -116,6 +118,7 @@ export function unicornConfig() {
|
|
|
116
118
|
'unicorn/prefer-array-some': 'error',
|
|
117
119
|
'unicorn/prefer-at': 'off',
|
|
118
120
|
'unicorn/prefer-blob-reading-methods': 'error',
|
|
121
|
+
'unicorn/prefer-class-fields': 'warn',
|
|
119
122
|
'unicorn/prefer-code-point': 'error',
|
|
120
123
|
'unicorn/prefer-date-now': 'warn',
|
|
121
124
|
'unicorn/prefer-default-parameters': 'warn',
|
|
@@ -173,6 +176,7 @@ export function unicornConfig() {
|
|
|
173
176
|
'unicorn/prevent-abbreviations': ['warn', unicornPreventAbbreviations()],
|
|
174
177
|
'unicorn/relative-url-style': ['warn', 'always'],
|
|
175
178
|
'unicorn/require-array-join-separator': 'warn',
|
|
179
|
+
'unicorn/require-module-specifiers': 'warn',
|
|
176
180
|
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
177
181
|
'unicorn/require-post-message-target-origin': 'error',
|
|
178
182
|
'unicorn/string-content': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "ESLint shareable rules configuration",
|
|
5
5
|
"keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
|
|
6
6
|
"author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
|
|
@@ -13,28 +13,24 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
16
|
-
"@stylistic/eslint-plugin": "^
|
|
17
|
-
"
|
|
18
|
-
"@stylistic/eslint-plugin-jsx": "^4.2.0",
|
|
19
|
-
"@stylistic/eslint-plugin-plus": "^4.2.0",
|
|
20
|
-
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
21
|
-
"eslint": "^9.25.1",
|
|
16
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
17
|
+
"eslint": "^9.34.0",
|
|
22
18
|
"eslint-import-resolver-typescript": "^3.10.1",
|
|
23
19
|
"eslint-plugin-array-func": "^5.0.2",
|
|
24
|
-
"eslint-plugin-cypress": "^
|
|
25
|
-
"eslint-plugin-import": "^2.
|
|
26
|
-
"eslint-plugin-jest": "^
|
|
20
|
+
"eslint-plugin-cypress": "^5.1.1",
|
|
21
|
+
"eslint-plugin-import": "^2.32.0",
|
|
22
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
27
23
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
28
|
-
"eslint-plugin-jsdoc": "^
|
|
29
|
-
"eslint-plugin-n": "^17.
|
|
24
|
+
"eslint-plugin-jsdoc": "^54.1.1",
|
|
25
|
+
"eslint-plugin-n": "^17.21.3",
|
|
30
26
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
31
27
|
"eslint-plugin-promise": "^7.2.1",
|
|
32
|
-
"eslint-plugin-rxjs-x": "~0.7.
|
|
28
|
+
"eslint-plugin-rxjs-x": "~0.7.7",
|
|
33
29
|
"eslint-plugin-security": "^3.0.1",
|
|
34
30
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
35
|
-
"eslint-plugin-testing-library": "^7.
|
|
36
|
-
"eslint-plugin-unicorn": "^
|
|
37
|
-
"typescript-eslint": "^8.
|
|
31
|
+
"eslint-plugin-testing-library": "^7.6.6",
|
|
32
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
33
|
+
"typescript-eslint": "^8.40.0"
|
|
38
34
|
},
|
|
39
35
|
"peerDependenciesMeta": {
|
|
40
36
|
"eslint-plugin-cypress": {
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import eslintPluginStylisticJs from '@stylistic/eslint-plugin-js';
|
|
2
|
-
export function stylisticJsConfig() {
|
|
3
|
-
return {
|
|
4
|
-
plugins: {
|
|
5
|
-
'@stylistic/js': eslintPluginStylisticJs
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
'@stylistic/js/array-bracket-newline': ['warn', 'consistent'],
|
|
9
|
-
'@stylistic/js/array-bracket-spacing': ['warn', 'never'],
|
|
10
|
-
'@stylistic/js/array-element-newline': ['warn', 'consistent'],
|
|
11
|
-
'@stylistic/js/arrow-parens': ['warn', 'as-needed'],
|
|
12
|
-
'@stylistic/js/arrow-spacing': ['warn', {
|
|
13
|
-
before: true,
|
|
14
|
-
after: true
|
|
15
|
-
}],
|
|
16
|
-
'@stylistic/js/block-spacing': ['warn', 'always'],
|
|
17
|
-
'@stylistic/js/brace-style': ['warn', 'stroustrup', {
|
|
18
|
-
allowSingleLine: false
|
|
19
|
-
}],
|
|
20
|
-
'@stylistic/js/comma-dangle': ['warn', {
|
|
21
|
-
arrays: 'always-multiline',
|
|
22
|
-
objects: 'always-multiline',
|
|
23
|
-
imports: 'always-multiline',
|
|
24
|
-
exports: 'always-multiline',
|
|
25
|
-
functions: 'always-multiline'
|
|
26
|
-
}],
|
|
27
|
-
'@stylistic/js/comma-spacing': ['warn', {
|
|
28
|
-
before: false,
|
|
29
|
-
after: true
|
|
30
|
-
}],
|
|
31
|
-
'@stylistic/js/comma-style': ['warn', 'last'],
|
|
32
|
-
'@stylistic/js/computed-property-spacing': ['warn', 'never'],
|
|
33
|
-
'@stylistic/js/dot-location': ['warn', 'property'],
|
|
34
|
-
'@stylistic/js/eol-last': ['warn', 'always'],
|
|
35
|
-
'@stylistic/js/func-call-spacing': 'off',
|
|
36
|
-
'@stylistic/js/function-call-argument-newline': ['warn', 'consistent'],
|
|
37
|
-
'@stylistic/js/function-call-spacing': ['warn', 'never'],
|
|
38
|
-
'@stylistic/js/function-paren-newline': ['warn', 'consistent'],
|
|
39
|
-
'@stylistic/js/generator-star-spacing': ['warn', {
|
|
40
|
-
before: true,
|
|
41
|
-
after: false
|
|
42
|
-
}],
|
|
43
|
-
'@stylistic/js/implicit-arrow-linebreak': ['warn', 'beside'],
|
|
44
|
-
'@stylistic/js/indent': ['warn', 4, {
|
|
45
|
-
SwitchCase: 1
|
|
46
|
-
}],
|
|
47
|
-
'@stylistic/js/jsx-quotes': ['warn', 'prefer-double'],
|
|
48
|
-
'@stylistic/js/key-spacing': ['warn', {
|
|
49
|
-
beforeColon: false,
|
|
50
|
-
afterColon: true,
|
|
51
|
-
mode: 'strict'
|
|
52
|
-
}],
|
|
53
|
-
'@stylistic/js/keyword-spacing': ['warn', {
|
|
54
|
-
before: true,
|
|
55
|
-
after: true
|
|
56
|
-
}],
|
|
57
|
-
'@stylistic/js/line-comment-position': ['error', {
|
|
58
|
-
position: 'above',
|
|
59
|
-
ignorePattern: '^ == .+'
|
|
60
|
-
}],
|
|
61
|
-
'@stylistic/js/linebreak-style': ['warn', 'unix'],
|
|
62
|
-
'@stylistic/js/lines-around-comment': ['warn', {
|
|
63
|
-
beforeBlockComment: true,
|
|
64
|
-
afterBlockComment: false,
|
|
65
|
-
beforeLineComment: false,
|
|
66
|
-
afterLineComment: false,
|
|
67
|
-
allowBlockStart: false,
|
|
68
|
-
allowBlockEnd: false,
|
|
69
|
-
allowObjectStart: false,
|
|
70
|
-
allowObjectEnd: false,
|
|
71
|
-
allowArrayStart: false,
|
|
72
|
-
allowArrayEnd: false,
|
|
73
|
-
allowClassStart: true,
|
|
74
|
-
allowClassEnd: false,
|
|
75
|
-
afterHashbangComment: true
|
|
76
|
-
}],
|
|
77
|
-
'@stylistic/js/lines-between-class-members': ['warn', 'always', {
|
|
78
|
-
exceptAfterSingleLine: true
|
|
79
|
-
}],
|
|
80
|
-
'@stylistic/js/max-len': ['error', {
|
|
81
|
-
code: 120,
|
|
82
|
-
tabWidth: 4,
|
|
83
|
-
ignoreRegExpLiterals: true,
|
|
84
|
-
ignoreUrls: true
|
|
85
|
-
}],
|
|
86
|
-
'@stylistic/js/max-statements-per-line': ['error', {
|
|
87
|
-
max: 1
|
|
88
|
-
}],
|
|
89
|
-
'@stylistic/js/multiline-comment-style': ['warn', 'separate-lines', {
|
|
90
|
-
checkJSDoc: false
|
|
91
|
-
}],
|
|
92
|
-
'@stylistic/js/multiline-ternary': ['warn', 'always-multiline'],
|
|
93
|
-
'@stylistic/js/new-parens': 'warn',
|
|
94
|
-
'@stylistic/js/newline-per-chained-call': ['off', {
|
|
95
|
-
ignoreChainWithDepth: 3
|
|
96
|
-
}],
|
|
97
|
-
'@stylistic/js/no-confusing-arrow': ['warn', {
|
|
98
|
-
allowParens: true,
|
|
99
|
-
onlyOneSimpleParam: false
|
|
100
|
-
}],
|
|
101
|
-
'@stylistic/js/no-extra-parens': ['warn', 'all', {
|
|
102
|
-
ignoreJSX: 'all',
|
|
103
|
-
nestedBinaryExpressions: false,
|
|
104
|
-
nestedConditionalExpressions: false,
|
|
105
|
-
enforceForArrowConditionals: false,
|
|
106
|
-
ternaryOperandBinaryExpressions: false
|
|
107
|
-
}],
|
|
108
|
-
'@stylistic/js/no-extra-semi': 'warn',
|
|
109
|
-
'@stylistic/js/no-floating-decimal': 'warn',
|
|
110
|
-
'@stylistic/js/no-mixed-operators': ['error', {
|
|
111
|
-
groups: [['+', '-'], ['*', '/', '%', '**'], ['&', '|', '^', '~', '<<', '>>', '>>>'], ['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['&&', '||', '?:', '??'], ['in', 'instanceof']],
|
|
112
|
-
allowSamePrecedence: true
|
|
113
|
-
}],
|
|
114
|
-
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
|
|
115
|
-
'@stylistic/js/no-multi-spaces': 'warn',
|
|
116
|
-
'@stylistic/js/no-multiple-empty-lines': ['warn', {
|
|
117
|
-
max: 1,
|
|
118
|
-
maxEOF: 0,
|
|
119
|
-
maxBOF: 0
|
|
120
|
-
}],
|
|
121
|
-
'@stylistic/js/no-tabs': 'error',
|
|
122
|
-
'@stylistic/js/no-trailing-spaces': 'warn',
|
|
123
|
-
'@stylistic/js/no-whitespace-before-property': 'warn',
|
|
124
|
-
'@stylistic/js/nonblock-statement-body-position': ['warn', 'below'],
|
|
125
|
-
'@stylistic/js/object-curly-newline': ['warn', {
|
|
126
|
-
ImportDeclaration: {
|
|
127
|
-
multiline: true
|
|
128
|
-
},
|
|
129
|
-
ExportDeclaration: {
|
|
130
|
-
multiline: true
|
|
131
|
-
}
|
|
132
|
-
}],
|
|
133
|
-
'@stylistic/js/object-curly-spacing': ['warn', 'always', {
|
|
134
|
-
arraysInObjects: true,
|
|
135
|
-
objectsInObjects: true
|
|
136
|
-
}],
|
|
137
|
-
'@stylistic/js/object-property-newline': ['warn', {
|
|
138
|
-
allowAllPropertiesOnSameLine: true
|
|
139
|
-
}],
|
|
140
|
-
'@stylistic/js/one-var-declaration-per-line': ['warn', 'always'],
|
|
141
|
-
'@stylistic/js/operator-linebreak': ['warn', 'before', {
|
|
142
|
-
overrides: {
|
|
143
|
-
'=': 'none',
|
|
144
|
-
'==': 'none',
|
|
145
|
-
'!=': 'none',
|
|
146
|
-
'>=': 'none',
|
|
147
|
-
'<=': 'none',
|
|
148
|
-
'===': 'none',
|
|
149
|
-
'+=': 'none'
|
|
150
|
-
}
|
|
151
|
-
}],
|
|
152
|
-
'@stylistic/js/padded-blocks': ['warn', 'never'],
|
|
153
|
-
'@stylistic/js/padding-line-between-statements': 'off',
|
|
154
|
-
'@stylistic/js/quote-props': ['warn', 'consistent-as-needed'],
|
|
155
|
-
'@stylistic/js/quotes': ['warn', 'single', {
|
|
156
|
-
avoidEscape: true,
|
|
157
|
-
allowTemplateLiterals: true,
|
|
158
|
-
ignoreStringLiterals: false
|
|
159
|
-
}],
|
|
160
|
-
'@stylistic/js/rest-spread-spacing': ['warn', 'never'],
|
|
161
|
-
'@stylistic/js/semi': ['warn', 'always'],
|
|
162
|
-
'@stylistic/js/semi-spacing': ['warn', {
|
|
163
|
-
before: false,
|
|
164
|
-
after: true
|
|
165
|
-
}],
|
|
166
|
-
'@stylistic/js/semi-style': ['warn', 'last'],
|
|
167
|
-
'@stylistic/js/space-before-blocks': ['warn', 'always'],
|
|
168
|
-
'@stylistic/js/space-before-function-paren': ['warn', {
|
|
169
|
-
anonymous: 'always',
|
|
170
|
-
named: 'never',
|
|
171
|
-
asyncArrow: 'always'
|
|
172
|
-
}],
|
|
173
|
-
'@stylistic/js/space-in-parens': ['warn', 'never'],
|
|
174
|
-
'@stylistic/js/space-infix-ops': ['warn', {
|
|
175
|
-
int32Hint: false
|
|
176
|
-
}],
|
|
177
|
-
'@stylistic/js/space-unary-ops': ['warn', {
|
|
178
|
-
words: true,
|
|
179
|
-
nonwords: false
|
|
180
|
-
}],
|
|
181
|
-
'@stylistic/js/spaced-comment': ['warn', 'always', {
|
|
182
|
-
line: {
|
|
183
|
-
markers: ['/ <reference']
|
|
184
|
-
}
|
|
185
|
-
}],
|
|
186
|
-
'@stylistic/js/switch-colon-spacing': ['warn', {
|
|
187
|
-
after: true,
|
|
188
|
-
before: false
|
|
189
|
-
}],
|
|
190
|
-
'@stylistic/js/template-curly-spacing': ['warn', 'never'],
|
|
191
|
-
'@stylistic/js/template-tag-spacing': ['warn', 'never'],
|
|
192
|
-
'@stylistic/js/wrap-iife': ['warn', 'outside'],
|
|
193
|
-
'@stylistic/js/wrap-regex': 'warn',
|
|
194
|
-
'@stylistic/js/yield-star-spacing': ['warn', {
|
|
195
|
-
before: true,
|
|
196
|
-
after: false
|
|
197
|
-
}]
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import eslintPluginStylisticJsx from '@stylistic/eslint-plugin-jsx';
|
|
2
|
-
import { jsxFiles, tsxFiles } from "../../../linter/glob.js";
|
|
3
|
-
import { languageOptions } from "../../../linter/language-options.js";
|
|
4
|
-
export function stylisticJsxConfig() {
|
|
5
|
-
return {
|
|
6
|
-
files: [jsxFiles, tsxFiles],
|
|
7
|
-
languageOptions: languageOptions(),
|
|
8
|
-
plugins: {
|
|
9
|
-
'@stylistic/jsx': eslintPluginStylisticJsx
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
'@stylistic/jsx/jsx-child-element-spacing': 'error',
|
|
13
|
-
'@stylistic/jsx/jsx-closing-bracket-location': ['warn', {
|
|
14
|
-
selfClosing: 'after-props',
|
|
15
|
-
nonEmpty: 'after-props'
|
|
16
|
-
}],
|
|
17
|
-
'@stylistic/jsx/jsx-closing-tag-location': ['warn', 'tag-aligned'],
|
|
18
|
-
'@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
|
|
19
|
-
props: 'never',
|
|
20
|
-
children: 'always',
|
|
21
|
-
propElementValues: 'always'
|
|
22
|
-
}],
|
|
23
|
-
'@stylistic/jsx/jsx-curly-newline': ['warn', 'never'],
|
|
24
|
-
'@stylistic/jsx/jsx-curly-spacing': ['warn', {
|
|
25
|
-
when: 'never',
|
|
26
|
-
attributes: {
|
|
27
|
-
allowMultiline: false
|
|
28
|
-
},
|
|
29
|
-
children: {
|
|
30
|
-
allowMultiline: false
|
|
31
|
-
}
|
|
32
|
-
}],
|
|
33
|
-
'@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
|
|
34
|
-
'@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
|
|
35
|
-
'@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
|
|
36
|
-
'@stylistic/jsx/jsx-indent': 'off',
|
|
37
|
-
'@stylistic/jsx/jsx-indent-props': ['warn', {
|
|
38
|
-
indentMode: 1,
|
|
39
|
-
ignoreTernaryOperator: false
|
|
40
|
-
}],
|
|
41
|
-
'@stylistic/jsx/jsx-max-props-per-line': ['warn', {
|
|
42
|
-
maximum: 1,
|
|
43
|
-
when: 'always'
|
|
44
|
-
}],
|
|
45
|
-
'@stylistic/jsx/jsx-newline': 'off',
|
|
46
|
-
'@stylistic/jsx/jsx-one-expression-per-line': ['warn', {
|
|
47
|
-
allow: 'single-child'
|
|
48
|
-
}],
|
|
49
|
-
'@stylistic/jsx/jsx-pascal-case': ['error', {
|
|
50
|
-
allowAllCaps: false,
|
|
51
|
-
allowLeadingUnderscore: false,
|
|
52
|
-
allowNamespace: false,
|
|
53
|
-
ignore: []
|
|
54
|
-
}],
|
|
55
|
-
'@stylistic/jsx/jsx-props-no-multi-spaces': 'warn',
|
|
56
|
-
'@stylistic/jsx/jsx-self-closing-comp': ['warn', {
|
|
57
|
-
component: true,
|
|
58
|
-
html: true
|
|
59
|
-
}],
|
|
60
|
-
'@stylistic/jsx/jsx-sort-props': ['warn', {
|
|
61
|
-
ignoreCase: false,
|
|
62
|
-
callbacksLast: true,
|
|
63
|
-
shorthandFirst: true,
|
|
64
|
-
shorthandLast: false,
|
|
65
|
-
multiline: 'ignore',
|
|
66
|
-
noSortAlphabetically: false,
|
|
67
|
-
reservedFirst: true,
|
|
68
|
-
locale: 'auto'
|
|
69
|
-
}],
|
|
70
|
-
'@stylistic/jsx/jsx-tag-spacing': ['warn', {
|
|
71
|
-
closingSlash: 'never',
|
|
72
|
-
beforeSelfClosing: 'always',
|
|
73
|
-
afterOpening: 'never',
|
|
74
|
-
beforeClosing: 'never'
|
|
75
|
-
}],
|
|
76
|
-
'@stylistic/jsx/jsx-wrap-multilines': ['warn', {
|
|
77
|
-
declaration: 'parens-new-line',
|
|
78
|
-
assignment: 'parens-new-line',
|
|
79
|
-
return: 'parens-new-line',
|
|
80
|
-
arrow: 'parens-new-line',
|
|
81
|
-
condition: 'parens-new-line',
|
|
82
|
-
logical: 'parens-new-line',
|
|
83
|
-
prop: 'parens-new-line'
|
|
84
|
-
}]
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import eslintPluginStylisticPlus from '@stylistic/eslint-plugin-plus';
|
|
2
|
-
export function stylisticPlusConfig() {
|
|
3
|
-
return {
|
|
4
|
-
plugins: {
|
|
5
|
-
'@stylistic/plus': eslintPluginStylisticPlus
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
'@stylistic/plus/curly-newline': ['warn', {
|
|
9
|
-
minElements: 1
|
|
10
|
-
}],
|
|
11
|
-
'@stylistic/plus/indent-binary-ops': ['warn', 4],
|
|
12
|
-
'@stylistic/plus/type-generic-spacing': 'warn',
|
|
13
|
-
'@stylistic/plus/type-named-tuple-spacing': 'warn'
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import eslintPluginStylisticTs from '@stylistic/eslint-plugin-ts';
|
|
2
|
-
import { typescriptFiles } from "../../../linter/glob.js";
|
|
3
|
-
import { typescriptLanguageOptions } from "../../../linter/language-options.js";
|
|
4
|
-
export function stylisticTsConfig() {
|
|
5
|
-
return {
|
|
6
|
-
files: typescriptFiles,
|
|
7
|
-
languageOptions: typescriptLanguageOptions(),
|
|
8
|
-
plugins: {
|
|
9
|
-
'@stylistic/ts': eslintPluginStylisticTs
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
'@stylistic/js/block-spacing': 'off',
|
|
13
|
-
'@stylistic/ts/block-spacing': ['warn', 'always'],
|
|
14
|
-
'@stylistic/js/brace-style': 'off',
|
|
15
|
-
'@stylistic/ts/brace-style': ['warn', 'stroustrup', {
|
|
16
|
-
allowSingleLine: false
|
|
17
|
-
}],
|
|
18
|
-
'@stylistic/js/comma-dangle': 'off',
|
|
19
|
-
'@stylistic/ts/comma-dangle': ['warn', {
|
|
20
|
-
arrays: 'always-multiline',
|
|
21
|
-
enums: 'always-multiline',
|
|
22
|
-
exports: 'always-multiline',
|
|
23
|
-
functions: 'always-multiline',
|
|
24
|
-
generics: 'always-multiline',
|
|
25
|
-
imports: 'always-multiline',
|
|
26
|
-
objects: 'always-multiline',
|
|
27
|
-
tuples: 'always-multiline'
|
|
28
|
-
}],
|
|
29
|
-
'@stylistic/js/comma-spacing': 'off',
|
|
30
|
-
'@stylistic/ts/comma-spacing': ['warn', {
|
|
31
|
-
before: false,
|
|
32
|
-
after: true
|
|
33
|
-
}],
|
|
34
|
-
'@stylistic/js/func-call-spacing': 'off',
|
|
35
|
-
'@stylistic/ts/func-call-spacing': 'off',
|
|
36
|
-
'@stylistic/js/function-call-spacing': 'off',
|
|
37
|
-
'@stylistic/ts/function-call-spacing': ['warn', 'never'],
|
|
38
|
-
'@stylistic/js/indent': 'off',
|
|
39
|
-
'@stylistic/ts/indent': ['warn', 4, {
|
|
40
|
-
SwitchCase: 1,
|
|
41
|
-
ignoredNodes: ['TSTypeParameterInstantiation']
|
|
42
|
-
}],
|
|
43
|
-
'@stylistic/js/key-spacing': 'off',
|
|
44
|
-
'@stylistic/ts/key-spacing': ['warn', {
|
|
45
|
-
beforeColon: false,
|
|
46
|
-
afterColon: true,
|
|
47
|
-
mode: 'strict'
|
|
48
|
-
}],
|
|
49
|
-
'@stylistic/js/keyword-spacing': 'off',
|
|
50
|
-
'@stylistic/ts/keyword-spacing': ['warn', {
|
|
51
|
-
before: true,
|
|
52
|
-
after: true
|
|
53
|
-
}],
|
|
54
|
-
'@stylistic/js/lines-around-comment': 'off',
|
|
55
|
-
'@stylistic/ts/lines-around-comment': ['warn', {
|
|
56
|
-
beforeBlockComment: true,
|
|
57
|
-
afterBlockComment: false,
|
|
58
|
-
beforeLineComment: false,
|
|
59
|
-
afterLineComment: false,
|
|
60
|
-
allowBlockStart: false,
|
|
61
|
-
allowBlockEnd: false,
|
|
62
|
-
allowObjectStart: false,
|
|
63
|
-
allowObjectEnd: false,
|
|
64
|
-
allowArrayStart: false,
|
|
65
|
-
allowArrayEnd: false,
|
|
66
|
-
allowClassStart: true,
|
|
67
|
-
allowClassEnd: false,
|
|
68
|
-
allowInterfaceStart: true,
|
|
69
|
-
allowInterfaceEnd: true,
|
|
70
|
-
allowTypeStart: true,
|
|
71
|
-
allowTypeEnd: true
|
|
72
|
-
}],
|
|
73
|
-
'@stylistic/js/lines-between-class-members': 'off',
|
|
74
|
-
'@stylistic/ts/lines-between-class-members': ['warn', 'always', {
|
|
75
|
-
exceptAfterSingleLine: true,
|
|
76
|
-
exceptAfterOverload: true
|
|
77
|
-
}],
|
|
78
|
-
'@stylistic/ts/member-delimiter-style': ['warn', {
|
|
79
|
-
multiline: {
|
|
80
|
-
delimiter: 'semi',
|
|
81
|
-
requireLast: true
|
|
82
|
-
},
|
|
83
|
-
singleline: {
|
|
84
|
-
delimiter: 'semi',
|
|
85
|
-
requireLast: true
|
|
86
|
-
},
|
|
87
|
-
multilineDetection: 'brackets'
|
|
88
|
-
}],
|
|
89
|
-
'@stylistic/js/no-extra-parens': 'off',
|
|
90
|
-
'@stylistic/ts/no-extra-parens': ['warn', 'all', {
|
|
91
|
-
ignoreJSX: 'all',
|
|
92
|
-
nestedBinaryExpressions: false,
|
|
93
|
-
enforceForArrowConditionals: false
|
|
94
|
-
}],
|
|
95
|
-
'@stylistic/js/no-extra-semi': 'off',
|
|
96
|
-
'@stylistic/ts/no-extra-semi': 'warn',
|
|
97
|
-
'@stylistic/js/object-curly-newline': 'off',
|
|
98
|
-
'@stylistic/ts/object-curly-newline': ['warn', {
|
|
99
|
-
ImportDeclaration: {
|
|
100
|
-
multiline: true
|
|
101
|
-
},
|
|
102
|
-
ExportDeclaration: {
|
|
103
|
-
multiline: true
|
|
104
|
-
}
|
|
105
|
-
}],
|
|
106
|
-
'@stylistic/js/object-curly-spacing': 'off',
|
|
107
|
-
'@stylistic/ts/object-curly-spacing': ['warn', 'always', {
|
|
108
|
-
arraysInObjects: true,
|
|
109
|
-
objectsInObjects: true
|
|
110
|
-
}],
|
|
111
|
-
'@stylistic/js/object-property-newline': 'off',
|
|
112
|
-
'@stylistic/ts/object-property-newline': ['warn', {
|
|
113
|
-
allowAllPropertiesOnSameLine: true
|
|
114
|
-
}],
|
|
115
|
-
'@stylistic/js/padding-line-between-statements': 'off',
|
|
116
|
-
'@stylistic/ts/padding-line-between-statements': 'off',
|
|
117
|
-
'@stylistic/js/quote-props': 'off',
|
|
118
|
-
'@stylistic/ts/quote-props': ['warn', 'consistent-as-needed'],
|
|
119
|
-
'@stylistic/js/quotes': 'off',
|
|
120
|
-
'@stylistic/ts/quotes': ['warn', 'single', {
|
|
121
|
-
avoidEscape: true,
|
|
122
|
-
allowTemplateLiterals: true
|
|
123
|
-
}],
|
|
124
|
-
'@stylistic/js/semi': 'off',
|
|
125
|
-
'@stylistic/ts/semi': ['warn', 'always'],
|
|
126
|
-
'@stylistic/js/space-before-blocks': 'off',
|
|
127
|
-
'@stylistic/ts/space-before-blocks': ['warn', 'always'],
|
|
128
|
-
'@stylistic/js/space-before-function-paren': 'off',
|
|
129
|
-
'@stylistic/ts/space-before-function-paren': ['warn', {
|
|
130
|
-
anonymous: 'always',
|
|
131
|
-
named: 'never',
|
|
132
|
-
asyncArrow: 'always'
|
|
133
|
-
}],
|
|
134
|
-
'@stylistic/js/space-infix-ops': 'off',
|
|
135
|
-
'@stylistic/ts/space-infix-ops': ['warn', {
|
|
136
|
-
int32Hint: false
|
|
137
|
-
}],
|
|
138
|
-
'@stylistic/ts/type-annotation-spacing': 'warn'
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|