eslint-plugin-svelte 2.40.0 → 2.41.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/lib/configs/all.d.ts +3 -5
- package/lib/configs/all.js +4 -3
- package/lib/configs/base.d.ts +3 -14
- package/lib/configs/base.js +2 -1
- package/lib/configs/flat/all.d.ts +3 -25
- package/lib/configs/flat/all.js +3 -1
- package/lib/configs/flat/base.d.ts +3 -24
- package/lib/configs/flat/base.js +4 -1
- package/lib/configs/flat/prettier.d.ts +3 -37
- package/lib/configs/flat/prettier.js +3 -4
- package/lib/configs/flat/recommended.d.ts +3 -40
- package/lib/configs/flat/recommended.js +3 -4
- package/lib/configs/prettier.d.ts +3 -17
- package/lib/configs/prettier.js +4 -6
- package/lib/configs/recommended.d.ts +3 -20
- package/lib/configs/recommended.js +4 -6
- package/lib/index.d.ts +8 -173
- package/lib/meta.d.ts +1 -1
- package/lib/meta.js +1 -1
- package/lib/processor/index.js +3 -3
- package/lib/rules/indent-helpers/ast.js +2 -3
- package/lib/rules/indent-helpers/commons.js +3 -4
- package/lib/rules/indent-helpers/es.js +16 -8
- package/lib/rules/indent-helpers/index.js +1 -2
- package/lib/rules/indent-helpers/svelte.js +1 -2
- package/lib/rules/indent-helpers/ts.js +1 -2
- package/lib/rules/reference-helpers/svelte-store.js +2 -3
- package/lib/shared/index.js +4 -4
- package/lib/shared/svelte-compile-warns/extract-leading-comments.js +1 -2
- package/lib/shared/svelte-compile-warns/ignore-comment.js +1 -2
- package/lib/shared/svelte-compile-warns/index.js +1 -2
- package/lib/shared/svelte-compile-warns/transform/babel.js +2 -3
- package/lib/shared/svelte-compile-warns/transform/less.js +1 -2
- package/lib/shared/svelte-compile-warns/transform/postcss.js +1 -2
- package/lib/shared/svelte-compile-warns/transform/sass.js +1 -2
- package/lib/shared/svelte-compile-warns/transform/stylus.js +1 -2
- package/lib/shared/svelte-compile-warns/transform/typescript.js +2 -3
- package/lib/utils/ast-utils.js +20 -21
- package/lib/utils/cache.js +1 -2
- package/lib/utils/compat.js +4 -5
- package/lib/utils/css-utils/style-attribute.js +1 -2
- package/lib/utils/css-utils/utils.js +3 -4
- package/lib/utils/eslint-core.js +4 -5
- package/lib/utils/get-package-json.js +1 -2
- package/lib/utils/index.js +1 -2
- package/lib/utils/load-module.js +2 -3
- package/lib/utils/regexp.js +2 -3
- package/lib/utils/svelte-kit.js +1 -2
- package/lib/utils/ts-utils/index.js +22 -23
- package/package.json +3 -3
package/lib/configs/all.d.ts
CHANGED
package/lib/configs/all.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
const
|
|
5
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
6
6
|
const rules_1 = require("../utils/rules");
|
|
7
7
|
const base = require.resolve('./base');
|
|
8
|
-
const baseExtend =
|
|
9
|
-
|
|
8
|
+
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
|
|
9
|
+
const config = {
|
|
10
10
|
extends: [baseExtend],
|
|
11
11
|
rules: Object.fromEntries(rules_1.rules
|
|
12
12
|
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error'])
|
|
@@ -15,3 +15,4 @@ module.exports = {
|
|
|
15
15
|
'svelte/no-restricted-html-elements'
|
|
16
16
|
].includes(ruleName)))
|
|
17
17
|
};
|
|
18
|
+
module.exports = config;
|
package/lib/configs/base.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
files: string[];
|
|
5
|
-
parser: string;
|
|
6
|
-
rules: {
|
|
7
|
-
'no-inner-declarations': string;
|
|
8
|
-
'no-self-assign': string;
|
|
9
|
-
'svelte/comment-directive': string;
|
|
10
|
-
'svelte/system': string;
|
|
11
|
-
};
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
14
|
-
export = _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.Config;
|
|
3
|
+
export = config;
|
package/lib/configs/base.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
files?: undefined;
|
|
6
|
-
languageOptions?: undefined;
|
|
7
|
-
rules?: undefined;
|
|
8
|
-
processor?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
files: string[];
|
|
11
|
-
languageOptions: {
|
|
12
|
-
parser: any;
|
|
13
|
-
};
|
|
14
|
-
rules: {
|
|
15
|
-
'no-inner-declarations': string;
|
|
16
|
-
'no-self-assign': string;
|
|
17
|
-
'svelte/comment-directive': string;
|
|
18
|
-
'svelte/system': string;
|
|
19
|
-
};
|
|
20
|
-
processor: string;
|
|
21
|
-
plugins?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
rules: any;
|
|
24
|
-
})[];
|
|
25
|
-
export default _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.FlatConfig[];
|
|
3
|
+
export default config;
|
package/lib/configs/flat/all.js
CHANGED
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const rules_1 = require("../../utils/rules");
|
|
7
7
|
const base_1 = __importDefault(require("./base"));
|
|
8
|
-
|
|
8
|
+
const config = [
|
|
9
9
|
...base_1.default,
|
|
10
10
|
{
|
|
11
|
+
name: 'svelte:all:rules',
|
|
11
12
|
rules: Object.fromEntries(rules_1.rules
|
|
12
13
|
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error'])
|
|
13
14
|
.filter(([ruleName]) => ![
|
|
@@ -16,3 +17,4 @@ exports.default = [
|
|
|
16
17
|
].includes(ruleName)))
|
|
17
18
|
}
|
|
18
19
|
];
|
|
20
|
+
exports.default = config;
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
readonly svelte: ESLint.Plugin;
|
|
5
|
-
};
|
|
6
|
-
files?: undefined;
|
|
7
|
-
languageOptions?: undefined;
|
|
8
|
-
rules?: undefined;
|
|
9
|
-
processor?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
files: string[];
|
|
12
|
-
languageOptions: {
|
|
13
|
-
parser: any;
|
|
14
|
-
};
|
|
15
|
-
rules: {
|
|
16
|
-
'no-inner-declarations': string;
|
|
17
|
-
'no-self-assign': string;
|
|
18
|
-
'svelte/comment-directive': string;
|
|
19
|
-
'svelte/system': string;
|
|
20
|
-
};
|
|
21
|
-
processor: string;
|
|
22
|
-
plugins?: undefined;
|
|
23
|
-
})[];
|
|
24
|
-
export default _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.FlatConfig[];
|
|
3
|
+
export default config;
|
package/lib/configs/flat/base.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const config = [
|
|
4
4
|
{
|
|
5
|
+
name: 'svelte:base:setup-plugin',
|
|
5
6
|
plugins: {
|
|
6
7
|
get svelte() {
|
|
7
8
|
// eslint-disable-next-line @typescript-eslint/no-require-imports -- ignore
|
|
@@ -10,6 +11,7 @@ exports.default = [
|
|
|
10
11
|
}
|
|
11
12
|
},
|
|
12
13
|
{
|
|
14
|
+
name: 'svelte:base:setup-for-svelte',
|
|
13
15
|
files: ['*.svelte', '**/*.svelte'],
|
|
14
16
|
languageOptions: {
|
|
15
17
|
// eslint-disable-next-line @typescript-eslint/no-require-imports -- ignore
|
|
@@ -28,3 +30,4 @@ exports.default = [
|
|
|
28
30
|
processor: 'svelte/svelte'
|
|
29
31
|
}
|
|
30
32
|
];
|
|
33
|
+
exports.default = config;
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
files?: undefined;
|
|
6
|
-
languageOptions?: undefined;
|
|
7
|
-
rules?: undefined;
|
|
8
|
-
processor?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
files: string[];
|
|
11
|
-
languageOptions: {
|
|
12
|
-
parser: any;
|
|
13
|
-
};
|
|
14
|
-
rules: {
|
|
15
|
-
'no-inner-declarations': string;
|
|
16
|
-
'no-self-assign': string;
|
|
17
|
-
'svelte/comment-directive': string;
|
|
18
|
-
'svelte/system': string;
|
|
19
|
-
};
|
|
20
|
-
processor: string;
|
|
21
|
-
plugins?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
rules: {
|
|
24
|
-
'svelte/first-attribute-linebreak': string;
|
|
25
|
-
'svelte/html-closing-bracket-spacing': string;
|
|
26
|
-
'svelte/html-quotes': string;
|
|
27
|
-
'svelte/html-self-closing': string;
|
|
28
|
-
'svelte/indent': string;
|
|
29
|
-
'svelte/max-attributes-per-line': string;
|
|
30
|
-
'svelte/mustache-spacing': string;
|
|
31
|
-
'svelte/no-spaces-around-equal-signs-in-attribute': string;
|
|
32
|
-
'svelte/no-trailing-spaces': string;
|
|
33
|
-
'svelte/shorthand-attribute': string;
|
|
34
|
-
'svelte/shorthand-directive': string;
|
|
35
|
-
};
|
|
36
|
-
})[];
|
|
37
|
-
export default _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.FlatConfig[];
|
|
3
|
+
export default config;
|
|
@@ -3,13 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// IMPORTANT!
|
|
7
|
-
// This file has been automatically generated,
|
|
8
|
-
// in order to update its content execute "pnpm run update"
|
|
9
6
|
const base_1 = __importDefault(require("./base"));
|
|
10
|
-
|
|
7
|
+
const config = [
|
|
11
8
|
...base_1.default,
|
|
12
9
|
{
|
|
10
|
+
name: 'svelte:prettier:turn-off-rules',
|
|
13
11
|
rules: {
|
|
14
12
|
// eslint-plugin-svelte rules
|
|
15
13
|
'svelte/first-attribute-linebreak': 'off',
|
|
@@ -26,3 +24,4 @@ exports.default = [
|
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
];
|
|
27
|
+
exports.default = config;
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
files?: undefined;
|
|
6
|
-
languageOptions?: undefined;
|
|
7
|
-
rules?: undefined;
|
|
8
|
-
processor?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
files: string[];
|
|
11
|
-
languageOptions: {
|
|
12
|
-
parser: any;
|
|
13
|
-
};
|
|
14
|
-
rules: {
|
|
15
|
-
'no-inner-declarations': string;
|
|
16
|
-
'no-self-assign': string;
|
|
17
|
-
'svelte/comment-directive': string;
|
|
18
|
-
'svelte/system': string;
|
|
19
|
-
};
|
|
20
|
-
processor: string;
|
|
21
|
-
plugins?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
rules: {
|
|
24
|
-
'svelte/comment-directive': string;
|
|
25
|
-
'svelte/no-at-debug-tags': string;
|
|
26
|
-
'svelte/no-at-html-tags': string;
|
|
27
|
-
'svelte/no-dupe-else-if-blocks': string;
|
|
28
|
-
'svelte/no-dupe-style-properties': string;
|
|
29
|
-
'svelte/no-dynamic-slot-name': string;
|
|
30
|
-
'svelte/no-inner-declarations': string;
|
|
31
|
-
'svelte/no-not-function-handler': string;
|
|
32
|
-
'svelte/no-object-in-text-mustaches': string;
|
|
33
|
-
'svelte/no-shorthand-style-property-overrides': string;
|
|
34
|
-
'svelte/no-unknown-style-directive-property': string;
|
|
35
|
-
'svelte/no-unused-svelte-ignore': string;
|
|
36
|
-
'svelte/system': string;
|
|
37
|
-
'svelte/valid-compile': string;
|
|
38
|
-
};
|
|
39
|
-
})[];
|
|
40
|
-
export default _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.FlatConfig[];
|
|
3
|
+
export default config;
|
|
@@ -3,13 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// IMPORTANT!
|
|
7
|
-
// This file has been automatically generated,
|
|
8
|
-
// in order to update its content execute "pnpm run update"
|
|
9
6
|
const base_1 = __importDefault(require("./base"));
|
|
10
|
-
|
|
7
|
+
const config = [
|
|
11
8
|
...base_1.default,
|
|
12
9
|
{
|
|
10
|
+
name: 'svelte:recommended:rules',
|
|
13
11
|
rules: {
|
|
14
12
|
// eslint-plugin-svelte rules
|
|
15
13
|
'svelte/comment-directive': 'error',
|
|
@@ -29,3 +27,4 @@ exports.default = [
|
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
];
|
|
30
|
+
exports.default = config;
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'svelte/first-attribute-linebreak': string;
|
|
5
|
-
'svelte/html-closing-bracket-spacing': string;
|
|
6
|
-
'svelte/html-quotes': string;
|
|
7
|
-
'svelte/html-self-closing': string;
|
|
8
|
-
'svelte/indent': string;
|
|
9
|
-
'svelte/max-attributes-per-line': string;
|
|
10
|
-
'svelte/mustache-spacing': string;
|
|
11
|
-
'svelte/no-spaces-around-equal-signs-in-attribute': string;
|
|
12
|
-
'svelte/no-trailing-spaces': string;
|
|
13
|
-
'svelte/shorthand-attribute': string;
|
|
14
|
-
'svelte/shorthand-directive': string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export = _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.Config;
|
|
3
|
+
export = config;
|
package/lib/configs/prettier.js
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
// This file has been automatically generated,
|
|
7
|
-
// in order to update its content execute "pnpm run update"
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
5
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
6
|
const base = require.resolve('./base');
|
|
10
|
-
const baseExtend =
|
|
11
|
-
|
|
7
|
+
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
|
|
8
|
+
const config = {
|
|
12
9
|
extends: [baseExtend],
|
|
13
10
|
rules: {
|
|
14
11
|
// eslint-plugin-svelte rules
|
|
@@ -25,3 +22,4 @@ module.exports = {
|
|
|
25
22
|
'svelte/shorthand-directive': 'off'
|
|
26
23
|
}
|
|
27
24
|
};
|
|
25
|
+
module.exports = config;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'svelte/comment-directive': string;
|
|
5
|
-
'svelte/no-at-debug-tags': string;
|
|
6
|
-
'svelte/no-at-html-tags': string;
|
|
7
|
-
'svelte/no-dupe-else-if-blocks': string;
|
|
8
|
-
'svelte/no-dupe-style-properties': string;
|
|
9
|
-
'svelte/no-dynamic-slot-name': string;
|
|
10
|
-
'svelte/no-inner-declarations': string;
|
|
11
|
-
'svelte/no-not-function-handler': string;
|
|
12
|
-
'svelte/no-object-in-text-mustaches': string;
|
|
13
|
-
'svelte/no-shorthand-style-property-overrides': string;
|
|
14
|
-
'svelte/no-unknown-style-directive-property': string;
|
|
15
|
-
'svelte/no-unused-svelte-ignore': string;
|
|
16
|
-
'svelte/system': string;
|
|
17
|
-
'svelte/valid-compile': string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export = _default;
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const config: Linter.Config;
|
|
3
|
+
export = config;
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
// This file has been automatically generated,
|
|
7
|
-
// in order to update its content execute "pnpm run update"
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
5
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
6
|
const base = require.resolve('./base');
|
|
10
|
-
const baseExtend =
|
|
11
|
-
|
|
7
|
+
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
|
|
8
|
+
const config = {
|
|
12
9
|
extends: [baseExtend],
|
|
13
10
|
rules: {
|
|
14
11
|
// eslint-plugin-svelte rules
|
|
@@ -28,3 +25,4 @@ module.exports = {
|
|
|
28
25
|
'svelte/valid-compile': 'error'
|
|
29
26
|
}
|
|
30
27
|
};
|
|
28
|
+
module.exports = config;
|
package/lib/index.d.ts
CHANGED
|
@@ -4,179 +4,14 @@ import * as processor from './processor';
|
|
|
4
4
|
declare const _default: {
|
|
5
5
|
meta: typeof processor.meta;
|
|
6
6
|
configs: {
|
|
7
|
-
base:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'svelte/comment-directive': string;
|
|
16
|
-
'svelte/system': string;
|
|
17
|
-
};
|
|
18
|
-
}[];
|
|
19
|
-
};
|
|
20
|
-
recommended: {
|
|
21
|
-
extends: string[];
|
|
22
|
-
rules: {
|
|
23
|
-
'svelte/comment-directive': string;
|
|
24
|
-
'svelte/no-at-debug-tags': string;
|
|
25
|
-
'svelte/no-at-html-tags': string;
|
|
26
|
-
'svelte/no-dupe-else-if-blocks': string;
|
|
27
|
-
'svelte/no-dupe-style-properties': string;
|
|
28
|
-
'svelte/no-dynamic-slot-name': string;
|
|
29
|
-
'svelte/no-inner-declarations': string;
|
|
30
|
-
'svelte/no-not-function-handler': string;
|
|
31
|
-
'svelte/no-object-in-text-mustaches': string;
|
|
32
|
-
'svelte/no-shorthand-style-property-overrides': string;
|
|
33
|
-
'svelte/no-unknown-style-directive-property': string;
|
|
34
|
-
'svelte/no-unused-svelte-ignore': string;
|
|
35
|
-
'svelte/system': string;
|
|
36
|
-
'svelte/valid-compile': string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
prettier: {
|
|
40
|
-
extends: string[];
|
|
41
|
-
rules: {
|
|
42
|
-
'svelte/first-attribute-linebreak': string;
|
|
43
|
-
'svelte/html-closing-bracket-spacing': string;
|
|
44
|
-
'svelte/html-quotes': string;
|
|
45
|
-
'svelte/html-self-closing': string;
|
|
46
|
-
'svelte/indent': string;
|
|
47
|
-
'svelte/max-attributes-per-line': string;
|
|
48
|
-
'svelte/mustache-spacing': string;
|
|
49
|
-
'svelte/no-spaces-around-equal-signs-in-attribute': string;
|
|
50
|
-
'svelte/no-trailing-spaces': string;
|
|
51
|
-
'svelte/shorthand-attribute': string;
|
|
52
|
-
'svelte/shorthand-directive': string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
all: {
|
|
56
|
-
extends: string[];
|
|
57
|
-
rules: any;
|
|
58
|
-
};
|
|
59
|
-
'flat/base': ({
|
|
60
|
-
plugins: {
|
|
61
|
-
readonly svelte: import("eslint").ESLint.Plugin;
|
|
62
|
-
};
|
|
63
|
-
files?: undefined;
|
|
64
|
-
languageOptions?: undefined;
|
|
65
|
-
rules?: undefined;
|
|
66
|
-
processor?: undefined;
|
|
67
|
-
} | {
|
|
68
|
-
files: string[];
|
|
69
|
-
languageOptions: {
|
|
70
|
-
parser: any;
|
|
71
|
-
};
|
|
72
|
-
rules: {
|
|
73
|
-
'no-inner-declarations': string;
|
|
74
|
-
'no-self-assign': string;
|
|
75
|
-
'svelte/comment-directive': string;
|
|
76
|
-
'svelte/system': string;
|
|
77
|
-
};
|
|
78
|
-
processor: string;
|
|
79
|
-
plugins?: undefined;
|
|
80
|
-
})[];
|
|
81
|
-
'flat/recommended': ({
|
|
82
|
-
plugins: {
|
|
83
|
-
readonly svelte: import("eslint").ESLint.Plugin;
|
|
84
|
-
};
|
|
85
|
-
files?: undefined;
|
|
86
|
-
languageOptions?: undefined;
|
|
87
|
-
rules?: undefined;
|
|
88
|
-
processor?: undefined;
|
|
89
|
-
} | {
|
|
90
|
-
files: string[];
|
|
91
|
-
languageOptions: {
|
|
92
|
-
parser: any;
|
|
93
|
-
};
|
|
94
|
-
rules: {
|
|
95
|
-
'no-inner-declarations': string;
|
|
96
|
-
'no-self-assign': string;
|
|
97
|
-
'svelte/comment-directive': string;
|
|
98
|
-
'svelte/system': string;
|
|
99
|
-
};
|
|
100
|
-
processor: string;
|
|
101
|
-
plugins?: undefined;
|
|
102
|
-
} | {
|
|
103
|
-
rules: {
|
|
104
|
-
'svelte/comment-directive': string;
|
|
105
|
-
'svelte/no-at-debug-tags': string;
|
|
106
|
-
'svelte/no-at-html-tags': string;
|
|
107
|
-
'svelte/no-dupe-else-if-blocks': string;
|
|
108
|
-
'svelte/no-dupe-style-properties': string;
|
|
109
|
-
'svelte/no-dynamic-slot-name': string;
|
|
110
|
-
'svelte/no-inner-declarations': string;
|
|
111
|
-
'svelte/no-not-function-handler': string;
|
|
112
|
-
'svelte/no-object-in-text-mustaches': string;
|
|
113
|
-
'svelte/no-shorthand-style-property-overrides': string;
|
|
114
|
-
'svelte/no-unknown-style-directive-property': string;
|
|
115
|
-
'svelte/no-unused-svelte-ignore': string;
|
|
116
|
-
'svelte/system': string;
|
|
117
|
-
'svelte/valid-compile': string;
|
|
118
|
-
};
|
|
119
|
-
})[];
|
|
120
|
-
'flat/prettier': ({
|
|
121
|
-
plugins: {
|
|
122
|
-
readonly svelte: import("eslint").ESLint.Plugin;
|
|
123
|
-
};
|
|
124
|
-
files?: undefined;
|
|
125
|
-
languageOptions?: undefined;
|
|
126
|
-
rules?: undefined;
|
|
127
|
-
processor?: undefined;
|
|
128
|
-
} | {
|
|
129
|
-
files: string[];
|
|
130
|
-
languageOptions: {
|
|
131
|
-
parser: any;
|
|
132
|
-
};
|
|
133
|
-
rules: {
|
|
134
|
-
'no-inner-declarations': string;
|
|
135
|
-
'no-self-assign': string;
|
|
136
|
-
'svelte/comment-directive': string;
|
|
137
|
-
'svelte/system': string;
|
|
138
|
-
};
|
|
139
|
-
processor: string;
|
|
140
|
-
plugins?: undefined;
|
|
141
|
-
} | {
|
|
142
|
-
rules: {
|
|
143
|
-
'svelte/first-attribute-linebreak': string;
|
|
144
|
-
'svelte/html-closing-bracket-spacing': string;
|
|
145
|
-
'svelte/html-quotes': string;
|
|
146
|
-
'svelte/html-self-closing': string;
|
|
147
|
-
'svelte/indent': string;
|
|
148
|
-
'svelte/max-attributes-per-line': string;
|
|
149
|
-
'svelte/mustache-spacing': string;
|
|
150
|
-
'svelte/no-spaces-around-equal-signs-in-attribute': string;
|
|
151
|
-
'svelte/no-trailing-spaces': string;
|
|
152
|
-
'svelte/shorthand-attribute': string;
|
|
153
|
-
'svelte/shorthand-directive': string;
|
|
154
|
-
};
|
|
155
|
-
})[];
|
|
156
|
-
'flat/all': ({
|
|
157
|
-
plugins: {
|
|
158
|
-
readonly svelte: import("eslint").ESLint.Plugin;
|
|
159
|
-
};
|
|
160
|
-
files?: undefined;
|
|
161
|
-
languageOptions?: undefined;
|
|
162
|
-
rules?: undefined;
|
|
163
|
-
processor?: undefined;
|
|
164
|
-
} | {
|
|
165
|
-
files: string[];
|
|
166
|
-
languageOptions: {
|
|
167
|
-
parser: any;
|
|
168
|
-
};
|
|
169
|
-
rules: {
|
|
170
|
-
'no-inner-declarations': string;
|
|
171
|
-
'no-self-assign': string;
|
|
172
|
-
'svelte/comment-directive': string;
|
|
173
|
-
'svelte/system': string;
|
|
174
|
-
};
|
|
175
|
-
processor: string;
|
|
176
|
-
plugins?: undefined;
|
|
177
|
-
} | {
|
|
178
|
-
rules: any;
|
|
179
|
-
})[];
|
|
7
|
+
base: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
|
|
8
|
+
recommended: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
|
|
9
|
+
prettier: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
|
|
10
|
+
all: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
|
|
11
|
+
'flat/base': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
|
|
12
|
+
'flat/recommended': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
|
|
13
|
+
'flat/prettier': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
|
|
14
|
+
'flat/all': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
|
|
180
15
|
};
|
|
181
16
|
rules: {
|
|
182
17
|
[key: string]: RuleModule;
|
package/lib/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "eslint-plugin-svelte";
|
|
2
|
-
export declare const version = "2.
|
|
2
|
+
export declare const version = "2.41.0";
|
package/lib/meta.js
CHANGED
package/lib/processor/index.js
CHANGED
|
@@ -23,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.supportsAutofix = exports.
|
|
26
|
+
exports.supportsAutofix = exports.meta = void 0;
|
|
27
|
+
exports.preprocess = preprocess;
|
|
28
|
+
exports.postprocess = postprocess;
|
|
27
29
|
const shared_1 = require("../shared");
|
|
28
30
|
exports.meta = __importStar(require("../meta"));
|
|
29
31
|
/** preprocess */
|
|
@@ -33,7 +35,6 @@ function preprocess(code, filename) {
|
|
|
33
35
|
}
|
|
34
36
|
return [code];
|
|
35
37
|
}
|
|
36
|
-
exports.preprocess = preprocess;
|
|
37
38
|
/** postprocess */
|
|
38
39
|
function postprocess([messages], filename) {
|
|
39
40
|
const shared = (0, shared_1.terminateShared)(filename);
|
|
@@ -42,7 +43,6 @@ function postprocess([messages], filename) {
|
|
|
42
43
|
}
|
|
43
44
|
return messages;
|
|
44
45
|
}
|
|
45
|
-
exports.postprocess = postprocess;
|
|
46
46
|
exports.supportsAutofix = true;
|
|
47
47
|
/** Filter */
|
|
48
48
|
function filter(messages, shared) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isWhitespace = isWhitespace;
|
|
4
|
+
exports.isNotWhitespace = isNotWhitespace;
|
|
4
5
|
/**
|
|
5
6
|
* Check whether the given token is a whitespace.
|
|
6
7
|
*/
|
|
@@ -9,7 +10,6 @@ function isWhitespace(token) {
|
|
|
9
10
|
((token.type === 'HTMLText' && !token.value.trim()) ||
|
|
10
11
|
(token.type === 'JSXText' && !token.value.trim())));
|
|
11
12
|
}
|
|
12
|
-
exports.isWhitespace = isWhitespace;
|
|
13
13
|
/**
|
|
14
14
|
* Check whether the given token is a not whitespace.
|
|
15
15
|
*/
|
|
@@ -18,4 +18,3 @@ function isNotWhitespace(token) {
|
|
|
18
18
|
(token.type !== 'HTMLText' || Boolean(token.value.trim())) &&
|
|
19
19
|
(token.type !== 'JSXText' || Boolean(token.value.trim())));
|
|
20
20
|
}
|
|
21
|
-
exports.isNotWhitespace = isNotWhitespace;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getFirstAndLastTokens = getFirstAndLastTokens;
|
|
4
|
+
exports.isBeginningOfLine = isBeginningOfLine;
|
|
5
|
+
exports.isBeginningOfElement = isBeginningOfElement;
|
|
4
6
|
const eslint_utils_1 = require("@eslint-community/eslint-utils");
|
|
5
7
|
const ast_1 = require("./ast");
|
|
6
8
|
/**
|
|
@@ -29,7 +31,6 @@ function getFirstAndLastTokens(sourceCode, node, borderOffset = 0) {
|
|
|
29
31
|
}
|
|
30
32
|
return { firstToken, lastToken };
|
|
31
33
|
}
|
|
32
|
-
exports.getFirstAndLastTokens = getFirstAndLastTokens;
|
|
33
34
|
/**
|
|
34
35
|
* Check whether the given node or token is the beginning of a line.
|
|
35
36
|
*/
|
|
@@ -40,7 +41,6 @@ function isBeginningOfLine(sourceCode, node) {
|
|
|
40
41
|
});
|
|
41
42
|
return !prevToken || prevToken.loc.end.line < node.loc.start.line;
|
|
42
43
|
}
|
|
43
|
-
exports.isBeginningOfLine = isBeginningOfLine;
|
|
44
44
|
/**
|
|
45
45
|
* Check whether the given node is the beginning of element.
|
|
46
46
|
*/
|
|
@@ -62,7 +62,6 @@ function isBeginningOfElement(node) {
|
|
|
62
62
|
}
|
|
63
63
|
return assertNever(node.parent);
|
|
64
64
|
}
|
|
65
|
-
exports.isBeginningOfElement = isBeginningOfElement;
|
|
66
65
|
/**
|
|
67
66
|
* Throws an error when invoked.
|
|
68
67
|
*/
|