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