@w5s/eslint-config 2.4.5 → 3.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/dist/index.cjs +4199 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8054 -0
- package/dist/index.d.ts +8054 -3
- package/dist/index.js +4171 -22
- package/dist/index.js.map +1 -0
- package/package.json +25 -16
- package/src/config/createRules.ts +5 -0
- package/src/config/es.ts +58 -0
- package/src/config/ignores.ts +84 -0
- package/src/config/imports.ts +32 -0
- package/src/config/jsdoc.ts +53 -0
- package/src/config/jsonc.ts +237 -0
- package/src/config/node.ts +42 -0
- package/src/config/stylistic.ts +50 -0
- package/src/config/test.ts +44 -0
- package/src/config/ts.ts +97 -0
- package/src/config/unicorn.ts +68 -0
- package/src/config/yml.ts +70 -0
- package/src/config.ts +11 -0
- package/src/defineConfig.ts +62 -0
- package/src/index.ts +3 -31
- package/src/type/Config.ts +5 -0
- package/src/type/PluginOptionsBase.ts +14 -0
- package/src/type/StylisticConfig.ts +39 -0
- package/src/type.ts +3 -0
- package/src/typegen/.keep +0 -0
- package/src/typegen/import.d.ts +501 -0
- package/src/typegen/jsdoc.d.ts +1155 -0
- package/src/typegen/jsonc.d.ts +500 -0
- package/src/typegen/node.d.ts +529 -0
- package/src/typegen/style.d.ts +1637 -0
- package/src/typegen/test.d.ts +430 -0
- package/src/typegen/ts.d.ts +1872 -0
- package/src/typegen/unicorn.d.ts +913 -0
- package/src/typegen/yml.d.ts +363 -0
- package/dist/es.d.ts +0 -3
- package/dist/es.js +0 -10
- package/dist/jest.d.ts +0 -3
- package/dist/jest.js +0 -20
- package/dist/json.d.ts +0 -3
- package/dist/json.js +0 -14
- package/dist/rules/es/base.d.ts +0 -4
- package/dist/rules/es/base.js +0 -71
- package/dist/rules/es/import.d.ts +0 -3
- package/dist/rules/es/import.js +0 -74
- package/dist/rules/es/jsdoc.d.ts +0 -3
- package/dist/rules/es/jsdoc.js +0 -21
- package/dist/rules/es/node.d.ts +0 -3
- package/dist/rules/es/node.js +0 -20
- package/dist/rules/es/promise.d.ts +0 -3
- package/dist/rules/es/promise.js +0 -11
- package/dist/rules/es/unicorn.d.ts +0 -3
- package/dist/rules/es/unicorn.js +0 -72
- package/dist/rules/es.d.ts +0 -3
- package/dist/rules/es.js +0 -14
- package/dist/rules/ignore.d.ts +0 -3
- package/dist/rules/ignore.js +0 -54
- package/dist/rules/jest.d.ts +0 -3
- package/dist/rules/jest.js +0 -64
- package/dist/rules/jsonc.d.ts +0 -3
- package/dist/rules/jsonc.js +0 -183
- package/dist/rules/prettier.d.ts +0 -3
- package/dist/rules/prettier.js +0 -13
- package/dist/rules/typescript.d.ts +0 -3
- package/dist/rules/typescript.js +0 -249
- package/dist/rules/yml.d.ts +0 -3
- package/dist/rules/yml.js +0 -21
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/typescript.d.ts +0 -3
- package/dist/typescript.js +0 -21
- package/dist/yml.d.ts +0 -3
- package/dist/yml.js +0 -19
- package/src/es.ts +0 -12
- package/src/jest.ts +0 -18
- package/src/json.ts +0 -12
- package/src/rules/es/base.ts +0 -83
- package/src/rules/es/import.ts +0 -81
- package/src/rules/es/jsdoc.ts +0 -23
- package/src/rules/es/node.ts +0 -21
- package/src/rules/es/promise.ts +0 -12
- package/src/rules/es/unicorn.ts +0 -74
- package/src/rules/es.ts +0 -21
- package/src/rules/ignore.ts +0 -54
- package/src/rules/jest.ts +0 -68
- package/src/rules/jsonc.ts +0 -187
- package/src/rules/prettier.ts +0 -11
- package/src/rules/typescript.ts +0 -255
- package/src/rules/yml.ts +0 -22
- package/src/typescript.ts +0 -24
- package/src/yml.ts +0 -18
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
/* eslint-disable unicorn/no-abusive-eslint-disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* prettier-ignore */
|
|
4
|
+
import type { Linter } from 'eslint'
|
|
5
|
+
|
|
6
|
+
declare module 'eslint' {
|
|
7
|
+
namespace Linter {
|
|
8
|
+
interface RulesRecord extends RuleOptions {}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RuleOptions {
|
|
13
|
+
/**
|
|
14
|
+
* require or disallow block style mappings.
|
|
15
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping.html
|
|
16
|
+
*/
|
|
17
|
+
'yml/block-mapping'?: Linter.RuleEntry<YmlBlockMapping>
|
|
18
|
+
/**
|
|
19
|
+
* enforce consistent line breaks after `:` indicator
|
|
20
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping-colon-indicator-newline.html
|
|
21
|
+
*/
|
|
22
|
+
'yml/block-mapping-colon-indicator-newline'?: Linter.RuleEntry<YmlBlockMappingColonIndicatorNewline>
|
|
23
|
+
/**
|
|
24
|
+
* enforce consistent line breaks after `?` indicator
|
|
25
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping-question-indicator-newline.html
|
|
26
|
+
*/
|
|
27
|
+
'yml/block-mapping-question-indicator-newline'?: Linter.RuleEntry<YmlBlockMappingQuestionIndicatorNewline>
|
|
28
|
+
/**
|
|
29
|
+
* require or disallow block style sequences.
|
|
30
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence.html
|
|
31
|
+
*/
|
|
32
|
+
'yml/block-sequence'?: Linter.RuleEntry<YmlBlockSequence>
|
|
33
|
+
/**
|
|
34
|
+
* enforce consistent line breaks after `-` indicator
|
|
35
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence-hyphen-indicator-newline.html
|
|
36
|
+
*/
|
|
37
|
+
'yml/block-sequence-hyphen-indicator-newline'?: Linter.RuleEntry<YmlBlockSequenceHyphenIndicatorNewline>
|
|
38
|
+
/**
|
|
39
|
+
* enforce YAML file extension
|
|
40
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/file-extension.html
|
|
41
|
+
*/
|
|
42
|
+
'yml/file-extension'?: Linter.RuleEntry<YmlFileExtension>
|
|
43
|
+
/**
|
|
44
|
+
* enforce consistent line breaks inside braces
|
|
45
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-newline.html
|
|
46
|
+
*/
|
|
47
|
+
'yml/flow-mapping-curly-newline'?: Linter.RuleEntry<YmlFlowMappingCurlyNewline>
|
|
48
|
+
/**
|
|
49
|
+
* enforce consistent spacing inside braces
|
|
50
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-spacing.html
|
|
51
|
+
*/
|
|
52
|
+
'yml/flow-mapping-curly-spacing'?: Linter.RuleEntry<YmlFlowMappingCurlySpacing>
|
|
53
|
+
/**
|
|
54
|
+
* enforce linebreaks after opening and before closing flow sequence brackets
|
|
55
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-newline.html
|
|
56
|
+
*/
|
|
57
|
+
'yml/flow-sequence-bracket-newline'?: Linter.RuleEntry<YmlFlowSequenceBracketNewline>
|
|
58
|
+
/**
|
|
59
|
+
* enforce consistent spacing inside flow sequence brackets
|
|
60
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-spacing.html
|
|
61
|
+
*/
|
|
62
|
+
'yml/flow-sequence-bracket-spacing'?: Linter.RuleEntry<YmlFlowSequenceBracketSpacing>
|
|
63
|
+
/**
|
|
64
|
+
* enforce consistent indentation
|
|
65
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/indent.html
|
|
66
|
+
*/
|
|
67
|
+
'yml/indent'?: Linter.RuleEntry<YmlIndent>
|
|
68
|
+
/**
|
|
69
|
+
* enforce naming convention to key names
|
|
70
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/key-name-casing.html
|
|
71
|
+
*/
|
|
72
|
+
'yml/key-name-casing'?: Linter.RuleEntry<YmlKeyNameCasing>
|
|
73
|
+
/**
|
|
74
|
+
* enforce consistent spacing between keys and values in mapping pairs
|
|
75
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/key-spacing.html
|
|
76
|
+
*/
|
|
77
|
+
'yml/key-spacing'?: Linter.RuleEntry<YmlKeySpacing>
|
|
78
|
+
/**
|
|
79
|
+
* disallow empty document
|
|
80
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-document.html
|
|
81
|
+
*/
|
|
82
|
+
'yml/no-empty-document'?: Linter.RuleEntry<[]>
|
|
83
|
+
/**
|
|
84
|
+
* disallow empty mapping keys
|
|
85
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-key.html
|
|
86
|
+
*/
|
|
87
|
+
'yml/no-empty-key'?: Linter.RuleEntry<[]>
|
|
88
|
+
/**
|
|
89
|
+
* disallow empty mapping values
|
|
90
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-mapping-value.html
|
|
91
|
+
*/
|
|
92
|
+
'yml/no-empty-mapping-value'?: Linter.RuleEntry<[]>
|
|
93
|
+
/**
|
|
94
|
+
* disallow empty sequence entries
|
|
95
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-sequence-entry.html
|
|
96
|
+
*/
|
|
97
|
+
'yml/no-empty-sequence-entry'?: Linter.RuleEntry<[]>
|
|
98
|
+
/**
|
|
99
|
+
* disallow irregular whitespace
|
|
100
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-irregular-whitespace.html
|
|
101
|
+
*/
|
|
102
|
+
'yml/no-irregular-whitespace'?: Linter.RuleEntry<YmlNoIrregularWhitespace>
|
|
103
|
+
/**
|
|
104
|
+
* disallow multiple empty lines
|
|
105
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-multiple-empty-lines.html
|
|
106
|
+
*/
|
|
107
|
+
'yml/no-multiple-empty-lines'?: Linter.RuleEntry<YmlNoMultipleEmptyLines>
|
|
108
|
+
/**
|
|
109
|
+
* disallow tabs for indentation.
|
|
110
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html
|
|
111
|
+
*/
|
|
112
|
+
'yml/no-tab-indent'?: Linter.RuleEntry<[]>
|
|
113
|
+
/**
|
|
114
|
+
* disallow trailing zeros for floats
|
|
115
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-zeros.html
|
|
116
|
+
*/
|
|
117
|
+
'yml/no-trailing-zeros'?: Linter.RuleEntry<[]>
|
|
118
|
+
/**
|
|
119
|
+
* require or disallow plain style scalar.
|
|
120
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/plain-scalar.html
|
|
121
|
+
*/
|
|
122
|
+
'yml/plain-scalar'?: Linter.RuleEntry<YmlPlainScalar>
|
|
123
|
+
/**
|
|
124
|
+
* enforce the consistent use of either double, or single quotes
|
|
125
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/quotes.html
|
|
126
|
+
*/
|
|
127
|
+
'yml/quotes'?: Linter.RuleEntry<YmlQuotes>
|
|
128
|
+
/**
|
|
129
|
+
* disallow mapping keys other than strings
|
|
130
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/require-string-key.html
|
|
131
|
+
*/
|
|
132
|
+
'yml/require-string-key'?: Linter.RuleEntry<[]>
|
|
133
|
+
/**
|
|
134
|
+
* require mapping keys to be sorted
|
|
135
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/sort-keys.html
|
|
136
|
+
*/
|
|
137
|
+
'yml/sort-keys'?: Linter.RuleEntry<YmlSortKeys>
|
|
138
|
+
/**
|
|
139
|
+
* require sequence values to be sorted
|
|
140
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/sort-sequence-values.html
|
|
141
|
+
*/
|
|
142
|
+
'yml/sort-sequence-values'?: Linter.RuleEntry<YmlSortSequenceValues>
|
|
143
|
+
/**
|
|
144
|
+
* enforce consistent spacing after the `#` in a comment
|
|
145
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/spaced-comment.html
|
|
146
|
+
*/
|
|
147
|
+
'yml/spaced-comment'?: Linter.RuleEntry<YmlSpacedComment>
|
|
148
|
+
/**
|
|
149
|
+
* disallow parsing errors in Vue custom blocks
|
|
150
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/vue-custom-block/no-parsing-error.html
|
|
151
|
+
*/
|
|
152
|
+
'yml/vue-custom-block/no-parsing-error'?: Linter.RuleEntry<[]>
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* ======= Declarations ======= */
|
|
156
|
+
// ----- yml/block-mapping -----
|
|
157
|
+
type YmlBlockMapping = []|[(("always" | "never") | {
|
|
158
|
+
singleline?: ("always" | "never" | "ignore")
|
|
159
|
+
multiline?: ("always" | "never" | "ignore")
|
|
160
|
+
})]
|
|
161
|
+
// ----- yml/block-mapping-colon-indicator-newline -----
|
|
162
|
+
type YmlBlockMappingColonIndicatorNewline = []|[("always" | "never")]
|
|
163
|
+
// ----- yml/block-mapping-question-indicator-newline -----
|
|
164
|
+
type YmlBlockMappingQuestionIndicatorNewline = []|[("always" | "never")]
|
|
165
|
+
// ----- yml/block-sequence -----
|
|
166
|
+
type YmlBlockSequence = []|[(("always" | "never") | {
|
|
167
|
+
singleline?: ("always" | "never" | "ignore")
|
|
168
|
+
multiline?: ("always" | "never" | "ignore")
|
|
169
|
+
})]
|
|
170
|
+
// ----- yml/block-sequence-hyphen-indicator-newline -----
|
|
171
|
+
type YmlBlockSequenceHyphenIndicatorNewline = []|[("always" | "never")]|[("always" | "never"), {
|
|
172
|
+
nestedHyphen?: ("always" | "never")
|
|
173
|
+
blockMapping?: ("always" | "never")
|
|
174
|
+
}]
|
|
175
|
+
// ----- yml/file-extension -----
|
|
176
|
+
type YmlFileExtension = []|[{
|
|
177
|
+
extension?: ("yaml" | "yml")
|
|
178
|
+
caseSensitive?: boolean
|
|
179
|
+
}]
|
|
180
|
+
// ----- yml/flow-mapping-curly-newline -----
|
|
181
|
+
type YmlFlowMappingCurlyNewline = []|[(("always" | "never") | {
|
|
182
|
+
multiline?: boolean
|
|
183
|
+
minProperties?: number
|
|
184
|
+
consistent?: boolean
|
|
185
|
+
})]
|
|
186
|
+
// ----- yml/flow-mapping-curly-spacing -----
|
|
187
|
+
type YmlFlowMappingCurlySpacing = []|[("always" | "never")]|[("always" | "never"), {
|
|
188
|
+
arraysInObjects?: boolean
|
|
189
|
+
objectsInObjects?: boolean
|
|
190
|
+
}]
|
|
191
|
+
// ----- yml/flow-sequence-bracket-newline -----
|
|
192
|
+
type YmlFlowSequenceBracketNewline = []|[(("always" | "never" | "consistent") | {
|
|
193
|
+
multiline?: boolean
|
|
194
|
+
minItems?: (number | null)
|
|
195
|
+
})]
|
|
196
|
+
// ----- yml/flow-sequence-bracket-spacing -----
|
|
197
|
+
type YmlFlowSequenceBracketSpacing = []|[("always" | "never")]|[("always" | "never"), {
|
|
198
|
+
singleValue?: boolean
|
|
199
|
+
objectsInArrays?: boolean
|
|
200
|
+
arraysInArrays?: boolean
|
|
201
|
+
}]
|
|
202
|
+
// ----- yml/indent -----
|
|
203
|
+
type YmlIndent = []|[number]|[number, {
|
|
204
|
+
indentBlockSequences?: boolean
|
|
205
|
+
indicatorValueIndent?: number
|
|
206
|
+
alignMultilineFlowScalars?: boolean
|
|
207
|
+
}]
|
|
208
|
+
// ----- yml/key-name-casing -----
|
|
209
|
+
type YmlKeyNameCasing = []|[{
|
|
210
|
+
camelCase?: boolean
|
|
211
|
+
PascalCase?: boolean
|
|
212
|
+
SCREAMING_SNAKE_CASE?: boolean
|
|
213
|
+
"kebab-case"?: boolean
|
|
214
|
+
snake_case?: boolean
|
|
215
|
+
ignores?: string[]
|
|
216
|
+
}]
|
|
217
|
+
// ----- yml/key-spacing -----
|
|
218
|
+
type YmlKeySpacing = []|[({
|
|
219
|
+
align?: (("colon" | "value") | {
|
|
220
|
+
on?: ("colon" | "value")
|
|
221
|
+
mode?: ("strict" | "minimum")
|
|
222
|
+
beforeColon?: boolean
|
|
223
|
+
afterColon?: boolean
|
|
224
|
+
})
|
|
225
|
+
mode?: ("strict" | "minimum")
|
|
226
|
+
beforeColon?: boolean
|
|
227
|
+
afterColon?: boolean
|
|
228
|
+
} | {
|
|
229
|
+
singleLine?: {
|
|
230
|
+
mode?: ("strict" | "minimum")
|
|
231
|
+
beforeColon?: boolean
|
|
232
|
+
afterColon?: boolean
|
|
233
|
+
}
|
|
234
|
+
multiLine?: {
|
|
235
|
+
align?: (("colon" | "value") | {
|
|
236
|
+
on?: ("colon" | "value")
|
|
237
|
+
mode?: ("strict" | "minimum")
|
|
238
|
+
beforeColon?: boolean
|
|
239
|
+
afterColon?: boolean
|
|
240
|
+
})
|
|
241
|
+
mode?: ("strict" | "minimum")
|
|
242
|
+
beforeColon?: boolean
|
|
243
|
+
afterColon?: boolean
|
|
244
|
+
}
|
|
245
|
+
} | {
|
|
246
|
+
singleLine?: {
|
|
247
|
+
mode?: ("strict" | "minimum")
|
|
248
|
+
beforeColon?: boolean
|
|
249
|
+
afterColon?: boolean
|
|
250
|
+
}
|
|
251
|
+
multiLine?: {
|
|
252
|
+
mode?: ("strict" | "minimum")
|
|
253
|
+
beforeColon?: boolean
|
|
254
|
+
afterColon?: boolean
|
|
255
|
+
}
|
|
256
|
+
align?: {
|
|
257
|
+
on?: ("colon" | "value")
|
|
258
|
+
mode?: ("strict" | "minimum")
|
|
259
|
+
beforeColon?: boolean
|
|
260
|
+
afterColon?: boolean
|
|
261
|
+
}
|
|
262
|
+
})]
|
|
263
|
+
// ----- yml/no-irregular-whitespace -----
|
|
264
|
+
type YmlNoIrregularWhitespace = []|[{
|
|
265
|
+
skipComments?: boolean
|
|
266
|
+
skipQuotedScalars?: boolean
|
|
267
|
+
}]
|
|
268
|
+
// ----- yml/no-multiple-empty-lines -----
|
|
269
|
+
type YmlNoMultipleEmptyLines = []|[{
|
|
270
|
+
max: number
|
|
271
|
+
maxEOF?: number
|
|
272
|
+
maxBOF?: number
|
|
273
|
+
}]
|
|
274
|
+
// ----- yml/plain-scalar -----
|
|
275
|
+
type YmlPlainScalar = []|[("always" | "never")]|[("always" | "never"), {
|
|
276
|
+
ignorePatterns?: string[]
|
|
277
|
+
overrides?: {
|
|
278
|
+
mappingKey?: ("always" | "never" | null)
|
|
279
|
+
}
|
|
280
|
+
}]
|
|
281
|
+
// ----- yml/quotes -----
|
|
282
|
+
type YmlQuotes = []|[{
|
|
283
|
+
prefer?: ("double" | "single")
|
|
284
|
+
avoidEscape?: boolean
|
|
285
|
+
}]
|
|
286
|
+
// ----- yml/sort-keys -----
|
|
287
|
+
type YmlSortKeys = ([{
|
|
288
|
+
pathPattern: string
|
|
289
|
+
hasProperties?: string[]
|
|
290
|
+
order: ((string | {
|
|
291
|
+
keyPattern?: string
|
|
292
|
+
order?: {
|
|
293
|
+
type?: ("asc" | "desc")
|
|
294
|
+
caseSensitive?: boolean
|
|
295
|
+
natural?: boolean
|
|
296
|
+
}
|
|
297
|
+
})[] | {
|
|
298
|
+
type?: ("asc" | "desc")
|
|
299
|
+
caseSensitive?: boolean
|
|
300
|
+
natural?: boolean
|
|
301
|
+
})
|
|
302
|
+
minKeys?: number
|
|
303
|
+
allowLineSeparatedGroups?: boolean
|
|
304
|
+
}, ...({
|
|
305
|
+
pathPattern: string
|
|
306
|
+
hasProperties?: string[]
|
|
307
|
+
order: ((string | {
|
|
308
|
+
keyPattern?: string
|
|
309
|
+
order?: {
|
|
310
|
+
type?: ("asc" | "desc")
|
|
311
|
+
caseSensitive?: boolean
|
|
312
|
+
natural?: boolean
|
|
313
|
+
}
|
|
314
|
+
})[] | {
|
|
315
|
+
type?: ("asc" | "desc")
|
|
316
|
+
caseSensitive?: boolean
|
|
317
|
+
natural?: boolean
|
|
318
|
+
})
|
|
319
|
+
minKeys?: number
|
|
320
|
+
allowLineSeparatedGroups?: boolean
|
|
321
|
+
})[]] | []|[("asc" | "desc")]|[("asc" | "desc"), {
|
|
322
|
+
caseSensitive?: boolean
|
|
323
|
+
natural?: boolean
|
|
324
|
+
minKeys?: number
|
|
325
|
+
allowLineSeparatedGroups?: boolean
|
|
326
|
+
}])
|
|
327
|
+
// ----- yml/sort-sequence-values -----
|
|
328
|
+
type YmlSortSequenceValues = [{
|
|
329
|
+
pathPattern: string
|
|
330
|
+
order: ((string | {
|
|
331
|
+
valuePattern?: string
|
|
332
|
+
order?: {
|
|
333
|
+
type?: ("asc" | "desc")
|
|
334
|
+
caseSensitive?: boolean
|
|
335
|
+
natural?: boolean
|
|
336
|
+
}
|
|
337
|
+
})[] | {
|
|
338
|
+
type?: ("asc" | "desc")
|
|
339
|
+
caseSensitive?: boolean
|
|
340
|
+
natural?: boolean
|
|
341
|
+
})
|
|
342
|
+
minValues?: number
|
|
343
|
+
}, ...({
|
|
344
|
+
pathPattern: string
|
|
345
|
+
order: ((string | {
|
|
346
|
+
valuePattern?: string
|
|
347
|
+
order?: {
|
|
348
|
+
type?: ("asc" | "desc")
|
|
349
|
+
caseSensitive?: boolean
|
|
350
|
+
natural?: boolean
|
|
351
|
+
}
|
|
352
|
+
})[] | {
|
|
353
|
+
type?: ("asc" | "desc")
|
|
354
|
+
caseSensitive?: boolean
|
|
355
|
+
natural?: boolean
|
|
356
|
+
})
|
|
357
|
+
minValues?: number
|
|
358
|
+
})[]]
|
|
359
|
+
// ----- yml/spaced-comment -----
|
|
360
|
+
type YmlSpacedComment = []|[("always" | "never")]|[("always" | "never"), {
|
|
361
|
+
exceptions?: string[]
|
|
362
|
+
markers?: string[]
|
|
363
|
+
}]
|
package/dist/es.d.ts
DELETED
package/dist/es.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const dev_1 = require("@w5s/dev");
|
|
6
|
-
const prettier_js_1 = __importDefault(require("./rules/prettier.js"));
|
|
7
|
-
const config = dev_1.ESLintConfig.concat({
|
|
8
|
-
extends: [require.resolve('./rules/es.js')],
|
|
9
|
-
}, prettier_js_1.default);
|
|
10
|
-
module.exports = config;
|
package/dist/jest.d.ts
DELETED
package/dist/jest.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const dev_1 = require("@w5s/dev");
|
|
6
|
-
const jest_js_1 = __importDefault(require("./rules/jest.js"));
|
|
7
|
-
const sourceGlob = dev_1.Project.extensionsToGlob(dev_1.Project.sourceExtensions());
|
|
8
|
-
const config = {
|
|
9
|
-
overrides: [
|
|
10
|
-
{
|
|
11
|
-
...jest_js_1.default,
|
|
12
|
-
files: [
|
|
13
|
-
`**/__mocks__/**/${sourceGlob}`,
|
|
14
|
-
`**/__tests__/**/${sourceGlob}`,
|
|
15
|
-
`**/?(*.)+(spec|test)${sourceGlob.slice(1)}`,
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
module.exports = config;
|
package/dist/json.d.ts
DELETED
package/dist/json.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const jsonc_js_1 = __importDefault(require("./rules/jsonc.js"));
|
|
6
|
-
const config = {
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
...jsonc_js_1.default,
|
|
10
|
-
files: ['*.json', '*.json5', '*.jsonc'],
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
};
|
|
14
|
-
module.exports = config;
|
package/dist/rules/es/base.d.ts
DELETED
package/dist/rules/es/base.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const dev_1 = require("@w5s/dev");
|
|
6
|
-
// Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
|
|
7
|
-
// @ts-ignore No typing available
|
|
8
|
-
require("@rushstack/eslint-patch/modern-module-resolution.js");
|
|
9
|
-
// @ts-ignore No typing available
|
|
10
|
-
const best_practices_1 = __importDefault(require("eslint-config-airbnb-base/rules/best-practices"));
|
|
11
|
-
// @ts-ignore No typing available
|
|
12
|
-
const errors_1 = __importDefault(require("eslint-config-airbnb-base/rules/errors"));
|
|
13
|
-
// @ts-ignore No typing available
|
|
14
|
-
const es6_1 = __importDefault(require("eslint-config-airbnb-base/rules/es6"));
|
|
15
|
-
// @ts-ignore No typing available
|
|
16
|
-
const node_1 = __importDefault(require("eslint-config-airbnb-base/rules/node"));
|
|
17
|
-
// @ts-ignore No typing available
|
|
18
|
-
const strict_1 = __importDefault(require("eslint-config-airbnb-base/rules/strict"));
|
|
19
|
-
// @ts-ignore No typing available
|
|
20
|
-
const style_1 = __importDefault(require("eslint-config-airbnb-base/rules/style"));
|
|
21
|
-
// @ts-ignore No typing available
|
|
22
|
-
const variables_1 = __importDefault(require("eslint-config-airbnb-base/rules/variables"));
|
|
23
|
-
const baseConfig = dev_1.ESLintConfig.concat(best_practices_1.default, errors_1.default, es6_1.default, node_1.default, strict_1.default, style_1.default, variables_1.default);
|
|
24
|
-
const config = dev_1.ESLintConfig.concat(baseConfig,
|
|
25
|
-
// overrides
|
|
26
|
-
{
|
|
27
|
-
env: {
|
|
28
|
-
[`es${dev_1.Project.ecmaVersion()}`]: true,
|
|
29
|
-
},
|
|
30
|
-
globals: {
|
|
31
|
-
__DEV__: 'readonly',
|
|
32
|
-
__PROD__: 'readonly',
|
|
33
|
-
__TEST__: 'readonly',
|
|
34
|
-
},
|
|
35
|
-
parser: 'espree',
|
|
36
|
-
parserOptions: {
|
|
37
|
-
ecmaFeatures: {
|
|
38
|
-
jsx: true,
|
|
39
|
-
},
|
|
40
|
-
ecmaVersion: dev_1.Project.ecmaVersion(),
|
|
41
|
-
sourceType: 'module',
|
|
42
|
-
},
|
|
43
|
-
reportUnusedDisableDirectives: true,
|
|
44
|
-
rules: {
|
|
45
|
-
// Too many errors in components
|
|
46
|
-
'class-methods-use-this': 'off',
|
|
47
|
-
// Annoying because it is not always wanted
|
|
48
|
-
'default-case': 'off',
|
|
49
|
-
// We do not want console.* in production. Disable this rule on a per line basis if needed
|
|
50
|
-
'no-console': 'error',
|
|
51
|
-
// Often useful in jsx
|
|
52
|
-
'no-nested-ternary': 'off',
|
|
53
|
-
// Too strict, for pure code prefer the functional plugin
|
|
54
|
-
'no-param-reassign': ['error', { props: false }],
|
|
55
|
-
// Allow for-of syntax
|
|
56
|
-
// @ts-ignore No typing available
|
|
57
|
-
'no-restricted-syntax': baseConfig.rules['no-restricted-syntax'].filter(
|
|
58
|
-
// @ts-ignore No typing available
|
|
59
|
-
({ selector }) => selector !== 'ForOfStatement'),
|
|
60
|
-
// underscore is often used (mongodb, etc)
|
|
61
|
-
'no-underscore-dangle': 'off',
|
|
62
|
-
// Ignore underscore case arguments
|
|
63
|
-
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
64
|
-
// Allow in some cases https://github.com/airbnb/javascript/issues/1089#issuecomment-1024351821
|
|
65
|
-
'no-use-before-define': ['error', 'nofunc'],
|
|
66
|
-
// Allow statements, to be compatible with '@typescript-eslint/no-floating-promises' fix
|
|
67
|
-
'no-void': ['error', { allowAsStatement: true }],
|
|
68
|
-
'unicode-bom': ['error', 'never'],
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
module.exports = config;
|
package/dist/rules/es/import.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const dev_1 = require("@w5s/dev");
|
|
6
|
-
// @ts-ignore airbnb is not typed
|
|
7
|
-
const imports_1 = __importDefault(require("eslint-config-airbnb-base/rules/imports"));
|
|
8
|
-
// @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
|
|
9
|
-
const extensionsToMatcher = (extensions) => `.{${extensions.map((_) => _.slice(1)).join(',')}}`;
|
|
10
|
-
const configFiles = [
|
|
11
|
-
// plopfile.js, plopfile.cjs, plopfile.mts, plopfile.ts, ...
|
|
12
|
-
`plopfile${extensionsToMatcher(dev_1.Project.queryExtensions(['javascript', 'typescript']))}`,
|
|
13
|
-
// dangerfile.js, dangerfile.cjs, dangerfile.mts, dangerfile.ts, ...
|
|
14
|
-
`dangerfile${extensionsToMatcher(dev_1.Project.queryExtensions(['javascript', 'typescript']))}`,
|
|
15
|
-
// *.config.js, *.config.cjs, *.config.mts, *.config.ts, ...
|
|
16
|
-
`**/*.config${extensionsToMatcher(dev_1.Project.queryExtensions(['javascript', 'typescript']))}`,
|
|
17
|
-
];
|
|
18
|
-
const config = dev_1.ESLintConfig.concat(imports_1.default,
|
|
19
|
-
// Overrides
|
|
20
|
-
{
|
|
21
|
-
rules: {
|
|
22
|
-
'import/extensions': [
|
|
23
|
-
'error',
|
|
24
|
-
'ignorePackages',
|
|
25
|
-
{
|
|
26
|
-
// js: 'never',
|
|
27
|
-
// jsx: 'never',
|
|
28
|
-
// mjs: 'never',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
'import/no-default-export': 'error', // Default exports are bad, especially when refactoring/renaming module
|
|
32
|
-
'import/no-deprecated': 'off', // Performance issues
|
|
33
|
-
'import/no-extraneous-dependencies': [
|
|
34
|
-
'error',
|
|
35
|
-
{
|
|
36
|
-
...imports_1.default.rules['import/no-extraneous-dependencies'][1],
|
|
37
|
-
devDependencies: [
|
|
38
|
-
...imports_1.default.rules['import/no-extraneous-dependencies'][1].devDependencies,
|
|
39
|
-
...configFiles,
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
'import/no-named-as-default': 'off', // Performance issues
|
|
44
|
-
'import/no-unused-modules': 'off', // Performance issues
|
|
45
|
-
'import/prefer-default-export': 'off', // Not aligned, default export does not bring sufficient semantic
|
|
46
|
-
'import/unambiguous': dev_1.ESLintConfig.fixme('off'), // Disable because proposal still in progress
|
|
47
|
-
},
|
|
48
|
-
settings: {
|
|
49
|
-
'import/extensions': dev_1.Project.sourceExtensions(),
|
|
50
|
-
// Resolve type definition packages
|
|
51
|
-
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
52
|
-
'import/ignore': [...dev_1.Project.ignored(), dev_1.Project.extensionsToMatcher(dev_1.Project.resourceExtensions()).source],
|
|
53
|
-
// Apply special parsing for TypeScript files
|
|
54
|
-
'import/parsers': {
|
|
55
|
-
'@typescript-eslint/parser': dev_1.Project.queryExtensions(['typescript', 'typescriptreact']),
|
|
56
|
-
},
|
|
57
|
-
// Append 'ts' extensions to Airbnb 'import/resolver' setting
|
|
58
|
-
'import/resolver': {
|
|
59
|
-
node: {
|
|
60
|
-
extensions: [...dev_1.Project.sourceExtensions(), '.json'],
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
}, {
|
|
65
|
-
overrides: [
|
|
66
|
-
{
|
|
67
|
-
files: [...configFiles, '**/*.d.ts'],
|
|
68
|
-
rules: {
|
|
69
|
-
'import/no-default-export': 'off', // Enable default exports only for config files
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
});
|
|
74
|
-
module.exports = config;
|
package/dist/rules/es/jsdoc.d.ts
DELETED
package/dist/rules/es/jsdoc.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const config = {
|
|
3
|
-
extends: ['plugin:jsdoc/recommended'],
|
|
4
|
-
plugins: ['jsdoc'],
|
|
5
|
-
rules: {
|
|
6
|
-
'jsdoc/no-undefined-types': 'off', // https://github.com/gajus/eslint-plugin-jsdoc/issues/839
|
|
7
|
-
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
|
|
8
|
-
'jsdoc/require-jsdoc': 'off',
|
|
9
|
-
'jsdoc/require-param-description': 'off',
|
|
10
|
-
'jsdoc/require-returns': 'off',
|
|
11
|
-
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
|
|
12
|
-
'jsdoc/valid-types': 'off', // FIXME: reports lots of false positive
|
|
13
|
-
strict: ['error', 'safe'],
|
|
14
|
-
},
|
|
15
|
-
settings: {
|
|
16
|
-
jsdoc: {
|
|
17
|
-
mode: 'typescript',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
module.exports = config;
|
package/dist/rules/es/node.d.ts
DELETED
package/dist/rules/es/node.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const config = {
|
|
3
|
-
extends: [],
|
|
4
|
-
plugins: ['n'],
|
|
5
|
-
rules: {
|
|
6
|
-
// 'n/handle-callback-err': ['error', '^(err|error|_error)$'],
|
|
7
|
-
'n/no-deprecated-api': 'error',
|
|
8
|
-
'n/no-exports-assign': 'error',
|
|
9
|
-
'n/no-new-require': 'error',
|
|
10
|
-
'n/no-path-concat': 'error',
|
|
11
|
-
'n/no-sync': 'error',
|
|
12
|
-
'n/prefer-global/buffer': ['error', 'never'],
|
|
13
|
-
'n/prefer-global/console': ['error', 'always'],
|
|
14
|
-
// 'n/prefer-global/process': ['error', 'never'],
|
|
15
|
-
'n/prefer-global/url': ['error', 'always'],
|
|
16
|
-
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
17
|
-
'n/process-exit-as-throw': 'error',
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
module.exports = config;
|
package/dist/rules/es/promise.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const dev_1 = require("@w5s/dev");
|
|
3
|
-
const config = dev_1.ESLintConfig.concat({
|
|
4
|
-
extends: ['plugin:promise/recommended'],
|
|
5
|
-
plugins: ['promise'],
|
|
6
|
-
rules: {
|
|
7
|
-
'promise/prefer-await-to-callbacks': dev_1.ESLintConfig.fixme('error'), // https://github.com/xjamundx/eslint-plugin-promise/issues/212
|
|
8
|
-
'promise/prefer-await-to-then': 'error',
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
module.exports = config;
|