-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathrule-types.ts
489 lines (480 loc) · 19 KB
/
rule-types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "pnpm run update"
/* eslint-disable */
/* prettier-ignore */
import type { Linter } from 'eslint'
declare module 'eslint' {
namespace Linter {
interface RulesRecord extends RuleOptions {}
}
}
export interface RuleOptions {
/**
* disallow conditionals where the type is always truthy or always falsy
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/@typescript-eslint/no-unnecessary-condition/
* @deprecated
*/
'svelte/@typescript-eslint/no-unnecessary-condition'?: Linter.RuleEntry<SvelteTypescriptEslintNoUnnecessaryCondition>
/**
* disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/block-lang/
*/
'svelte/block-lang'?: Linter.RuleEntry<SvelteBlockLang>
/**
* disallow usage of button without an explicit type attribute
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/button-has-type/
*/
'svelte/button-has-type'?: Linter.RuleEntry<SvelteButtonHasType>
/**
* support comment-directives in HTML template
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/comment-directive/
*/
'svelte/comment-directive'?: Linter.RuleEntry<SvelteCommentDirective>
/**
* derived store should use same variable names between values and callback
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/derived-has-same-inputs-outputs/
*/
'svelte/derived-has-same-inputs-outputs'?: Linter.RuleEntry<[]>
/**
* require slot type declaration using the `$$Slots` interface
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/experimental-require-slot-types/
*/
'svelte/experimental-require-slot-types'?: Linter.RuleEntry<[]>
/**
* require the strictEvents attribute on `<script>` tags
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/experimental-require-strict-events/
*/
'svelte/experimental-require-strict-events'?: Linter.RuleEntry<[]>
/**
* enforce the location of first attribute
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/first-attribute-linebreak/
*/
'svelte/first-attribute-linebreak'?: Linter.RuleEntry<SvelteFirstAttributeLinebreak>
/**
* require or disallow a space before tag's closing brackets
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/html-closing-bracket-spacing/
*/
'svelte/html-closing-bracket-spacing'?: Linter.RuleEntry<SvelteHtmlClosingBracketSpacing>
/**
* enforce quotes style of HTML attributes
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/html-quotes/
*/
'svelte/html-quotes'?: Linter.RuleEntry<SvelteHtmlQuotes>
/**
* enforce self-closing style
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/html-self-closing/
*/
'svelte/html-self-closing'?: Linter.RuleEntry<SvelteHtmlSelfClosing>
/**
* enforce consistent indentation
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/indent/
*/
'svelte/indent'?: Linter.RuleEntry<SvelteIndent>
/**
* Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/infinite-reactive-loop/
*/
'svelte/infinite-reactive-loop'?: Linter.RuleEntry<[]>
/**
* enforce the maximum number of attributes per line
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/max-attributes-per-line/
*/
'svelte/max-attributes-per-line'?: Linter.RuleEntry<SvelteMaxAttributesPerLine>
/**
* enforce unified spacing in mustache
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/mustache-spacing/
*/
'svelte/mustache-spacing'?: Linter.RuleEntry<SvelteMustacheSpacing>
/**
* disallow the use of `{@debug}`
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-debug-tags/
*/
'svelte/no-at-debug-tags'?: Linter.RuleEntry<[]>
/**
* disallow use of `{@html}` to prevent XSS attack
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-html-tags/
*/
'svelte/no-at-html-tags'?: Linter.RuleEntry<[]>
/**
* disallow DOM manipulating
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dom-manipulating/
*/
'svelte/no-dom-manipulating'?: Linter.RuleEntry<[]>
/**
* disallow duplicate conditions in `{#if}` / `{:else if}` chains
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks/
*/
'svelte/no-dupe-else-if-blocks'?: Linter.RuleEntry<[]>
/**
* disallow duplicate `on:` directives
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-on-directives/
*/
'svelte/no-dupe-on-directives'?: Linter.RuleEntry<[]>
/**
* disallow duplicate style properties
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-style-properties/
*/
'svelte/no-dupe-style-properties'?: Linter.RuleEntry<[]>
/**
* disallow duplicate `use:` directives
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-use-directives/
*/
'svelte/no-dupe-use-directives'?: Linter.RuleEntry<[]>
/**
* disallow dynamic slot name
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/
*/
'svelte/no-dynamic-slot-name'?: Linter.RuleEntry<[]>
/**
* disallow exporting load functions in `*.svelte` module in SvelteKit page components.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/
*/
'svelte/no-export-load-in-svelte-module-in-kit-pages'?: Linter.RuleEntry<[]>
/**
* disallow wrapping single reactive statements in curly braces
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-extra-reactive-curlies/
*/
'svelte/no-extra-reactive-curlies'?: Linter.RuleEntry<[]>
/**
* disallow using goto() without the base path
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/
*/
'svelte/no-goto-without-base'?: Linter.RuleEntry<[]>
/**
* disallow ignoring the unsubscribe method returned by the `subscribe()` on Svelte stores.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-ignored-unsubscribe/
*/
'svelte/no-ignored-unsubscribe'?: Linter.RuleEntry<[]>
/**
* disallow reactive statements that don't reference reactive values.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-immutable-reactive-statements/
*/
'svelte/no-immutable-reactive-statements'?: Linter.RuleEntry<[]>
/**
* disallow attributes and directives that produce inline styles
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inline-styles/
*/
'svelte/no-inline-styles'?: Linter.RuleEntry<SvelteNoInlineStyles>
/**
* disallow variable or `function` declarations in nested blocks
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inner-declarations/
*/
'svelte/no-inner-declarations'?: Linter.RuleEntry<SvelteNoInnerDeclarations>
/**
* disallow use of not function in event handler
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/
*/
'svelte/no-not-function-handler'?: Linter.RuleEntry<[]>
/**
* disallow objects in text mustache interpolation
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches/
*/
'svelte/no-object-in-text-mustaches'?: Linter.RuleEntry<[]>
/**
* it's not necessary to define functions in reactive statements
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-functions/
*/
'svelte/no-reactive-functions'?: Linter.RuleEntry<[]>
/**
* don't assign literal values in reactive statements
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-literals/
*/
'svelte/no-reactive-literals'?: Linter.RuleEntry<[]>
/**
* disallow reassigning reactive values
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-reassign/
*/
'svelte/no-reactive-reassign'?: Linter.RuleEntry<SvelteNoReactiveReassign>
/**
* disallow specific HTML elements
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-restricted-html-elements/
*/
'svelte/no-restricted-html-elements'?: Linter.RuleEntry<SvelteNoRestrictedHtmlElements>
/**
* disallow shorthand style properties that override related longhand properties
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-shorthand-style-property-overrides/
*/
'svelte/no-shorthand-style-property-overrides'?: Linter.RuleEntry<[]>
/**
* disallow spaces around equal signs in attribute
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-spaces-around-equal-signs-in-attribute/
*/
'svelte/no-spaces-around-equal-signs-in-attribute'?: Linter.RuleEntry<[]>
/**
* disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-store-async/
*/
'svelte/no-store-async'?: Linter.RuleEntry<[]>
/**
* svelte/internal will be removed in Svelte 6.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-svelte-internal/
*/
'svelte/no-svelte-internal'?: Linter.RuleEntry<[]>
/**
* disallow `target="_blank"` attribute without `rel="noopener noreferrer"`
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-target-blank/
*/
'svelte/no-target-blank'?: Linter.RuleEntry<SvelteNoTargetBlank>
/**
* disallow trailing whitespace at the end of lines
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-trailing-spaces/
*/
'svelte/no-trailing-spaces'?: Linter.RuleEntry<SvelteNoTrailingSpaces>
/**
* disallow unknown `style:property`
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unknown-style-directive-property/
*/
'svelte/no-unknown-style-directive-property'?: Linter.RuleEntry<SvelteNoUnknownStyleDirectiveProperty>
/**
* disallow the use of a class in the template without a corresponding style
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unused-class-name/
*/
'svelte/no-unused-class-name'?: Linter.RuleEntry<SvelteNoUnusedClassName>
/**
* disallow unused svelte-ignore comments
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unused-svelte-ignore/
*/
'svelte/no-unused-svelte-ignore'?: Linter.RuleEntry<[]>
/**
* disallow unnecessary mustache interpolations
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-useless-mustaches/
*/
'svelte/no-useless-mustaches'?: Linter.RuleEntry<SvelteNoUselessMustaches>
/**
* require class directives instead of ternary expressions
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-class-directive/
*/
'svelte/prefer-class-directive'?: Linter.RuleEntry<SveltePreferClassDirective>
/**
* destructure values from object stores for better change tracking & fewer redraws
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-destructured-store-props/
*/
'svelte/prefer-destructured-store-props'?: Linter.RuleEntry<[]>
/**
* require style directives instead of style attribute
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-style-directive/
*/
'svelte/prefer-style-directive'?: Linter.RuleEntry<[]>
/**
* require keyed `{#each}` block
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-each-key/
*/
'svelte/require-each-key'?: Linter.RuleEntry<[]>
/**
* require type parameters for `createEventDispatcher`
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-event-dispatcher-types/
*/
'svelte/require-event-dispatcher-types'?: Linter.RuleEntry<[]>
/**
* require style attributes that can be optimized
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-optimized-style-attribute/
*/
'svelte/require-optimized-style-attribute'?: Linter.RuleEntry<[]>
/**
* store callbacks must use `set` param
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-callbacks-use-set-param/
*/
'svelte/require-store-callbacks-use-set-param'?: Linter.RuleEntry<[]>
/**
* disallow to use of the store itself as an operand. Need to use $ prefix or get function.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-reactive-access/
*/
'svelte/require-store-reactive-access'?: Linter.RuleEntry<[]>
/**
* require initial value in store
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/require-stores-init/
*/
'svelte/require-stores-init'?: Linter.RuleEntry<[]>
/**
* use let instead of const for reactive variables created by runes
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/rune-prefer-let/
*/
'svelte/rune-prefer-let'?: Linter.RuleEntry<[]>
/**
* enforce use of shorthand syntax in attribute
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/shorthand-attribute/
*/
'svelte/shorthand-attribute'?: Linter.RuleEntry<SvelteShorthandAttribute>
/**
* enforce use of shorthand syntax in directives
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/shorthand-directive/
*/
'svelte/shorthand-directive'?: Linter.RuleEntry<SvelteShorthandDirective>
/**
* enforce order of attributes
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/sort-attributes/
*/
'svelte/sort-attributes'?: Linter.RuleEntry<SvelteSortAttributes>
/**
* enforce consistent spacing after the `<!--` and before the `-->` in a HTML comment
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/spaced-html-comment/
*/
'svelte/spaced-html-comment'?: Linter.RuleEntry<SvelteSpacedHtmlComment>
/**
* system rule for working this plugin
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/system/
*/
'svelte/system'?: Linter.RuleEntry<[]>
/**
* disallow warnings when compiling.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-compile/
*/
'svelte/valid-compile'?: Linter.RuleEntry<SvelteValidCompile>
/**
* enforce keys to use variables defined in the `{#each}` block
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-each-key/
*/
'svelte/valid-each-key'?: Linter.RuleEntry<[]>
/**
* disallow props other than data or errors in SvelteKit page components.
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-prop-names-in-kit-pages/
*/
'svelte/valid-prop-names-in-kit-pages'?: Linter.RuleEntry<[]>
}
/* ======= Declarations ======= */
// ----- svelte/@typescript-eslint/no-unnecessary-condition -----
type SvelteTypescriptEslintNoUnnecessaryCondition = []|[{
allowConstantLoopConditions?: boolean
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean
}]
// ----- svelte/block-lang -----
type SvelteBlockLang = []|[{
enforceScriptPresent?: boolean
enforceStylePresent?: boolean
script?: ((string | null) | [(string | null), ...((string | null))[]])
style?: ((string | null) | [(string | null), ...((string | null))[]])
}]
// ----- svelte/button-has-type -----
type SvelteButtonHasType = []|[{
button?: boolean
submit?: boolean
reset?: boolean
}]
// ----- svelte/comment-directive -----
type SvelteCommentDirective = []|[{
reportUnusedDisableDirectives?: boolean
}]
// ----- svelte/first-attribute-linebreak -----
type SvelteFirstAttributeLinebreak = []|[{
multiline?: ("below" | "beside")
singleline?: ("below" | "beside")
}]
// ----- svelte/html-closing-bracket-spacing -----
type SvelteHtmlClosingBracketSpacing = []|[{
startTag?: ("always" | "never" | "ignore")
endTag?: ("always" | "never" | "ignore")
selfClosingTag?: ("always" | "never" | "ignore")
}]
// ----- svelte/html-quotes -----
type SvelteHtmlQuotes = []|[{
prefer?: ("double" | "single")
dynamic?: {
quoted?: boolean
avoidInvalidUnquotedInHTML?: boolean
}
}]
// ----- svelte/html-self-closing -----
type SvelteHtmlSelfClosing = []|[({
void?: ("never" | "always" | "ignore")
normal?: ("never" | "always" | "ignore")
component?: ("never" | "always" | "ignore")
svelte?: ("never" | "always" | "ignore")
} | ("all" | "html" | "none"))]
// ----- svelte/indent -----
type SvelteIndent = []|[{
indent?: (number | "tab")
indentScript?: boolean
switchCase?: number
alignAttributesVertically?: boolean
ignoredNodes?: (string & {
[k: string]: unknown | undefined
} & {
[k: string]: unknown | undefined
})[]
}]
// ----- svelte/max-attributes-per-line -----
type SvelteMaxAttributesPerLine = []|[{
multiline?: number
singleline?: number
}]
// ----- svelte/mustache-spacing -----
type SvelteMustacheSpacing = []|[{
textExpressions?: ("never" | "always")
attributesAndProps?: ("never" | "always")
directiveExpressions?: ("never" | "always")
tags?: {
openingBrace?: ("never" | "always")
closingBrace?: ("never" | "always" | "always-after-expression")
}
}]
// ----- svelte/no-inline-styles -----
type SvelteNoInlineStyles = []|[{
allowTransitions?: boolean
}]
// ----- svelte/no-inner-declarations -----
type SvelteNoInnerDeclarations = []|[("functions" | "both")]|[("functions" | "both"), {
blockScopedFunctions?: ("allow" | "disallow")
}]
// ----- svelte/no-reactive-reassign -----
type SvelteNoReactiveReassign = []|[{
props?: boolean
}]
// ----- svelte/no-restricted-html-elements -----
type SvelteNoRestrictedHtmlElements = [(string | {
elements?: [string, ...(string)[]]
message?: string
}), ...((string | {
elements?: [string, ...(string)[]]
message?: string
}))[]]
// ----- svelte/no-target-blank -----
type SvelteNoTargetBlank = []|[{
allowReferrer?: boolean
enforceDynamicLinks?: ("always" | "never")
}]
// ----- svelte/no-trailing-spaces -----
type SvelteNoTrailingSpaces = []|[{
skipBlankLines?: boolean
ignoreComments?: boolean
}]
// ----- svelte/no-unknown-style-directive-property -----
type SvelteNoUnknownStyleDirectiveProperty = []|[{
ignoreProperties?: [string, ...(string)[]]
ignorePrefixed?: boolean
}]
// ----- svelte/no-unused-class-name -----
type SvelteNoUnusedClassName = []|[{
allowedClassNames?: string[]
}]
// ----- svelte/no-useless-mustaches -----
type SvelteNoUselessMustaches = []|[{
ignoreIncludesComment?: boolean
ignoreStringEscape?: boolean
}]
// ----- svelte/prefer-class-directive -----
type SveltePreferClassDirective = []|[{
prefer?: ("always" | "empty")
}]
// ----- svelte/shorthand-attribute -----
type SvelteShorthandAttribute = []|[{
prefer?: ("always" | "never")
}]
// ----- svelte/shorthand-directive -----
type SvelteShorthandDirective = []|[{
prefer?: ("always" | "never")
}]
// ----- svelte/sort-attributes -----
type SvelteSortAttributes = []|[{
order?: (string | [string, ...(string)[]] | {
match: (string | [string, ...(string)[]])
sort: ("alphabetical" | "ignore")
})[]
alphabetical?: boolean
}]
// ----- svelte/spaced-html-comment -----
type SvelteSpacedHtmlComment = []|[("always" | "never")]
// ----- svelte/valid-compile -----
type SvelteValidCompile = []|[{
ignoreWarnings?: boolean
}]