eslint-plugin-svelte 2.38.0 → 2.39.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 +1 -0
- package/lib/meta.d.ts +1 -1
- package/lib/meta.js +1 -1
- package/lib/rule-types.d.ts +5 -0
- package/lib/rules/no-svelte-internal.d.ts +2 -0
- package/lib/rules/no-svelte-internal.js +55 -0
- package/lib/utils/rules.js +2 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -385,6 +385,7 @@ These rules relate to better ways of doing things to help you avoid problems:
|
|
|
385
385
|
| [svelte/no-inline-styles](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inline-styles/) | disallow attributes and directives that produce inline styles | |
|
|
386
386
|
| [svelte/no-reactive-functions](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-functions/) | it's not necessary to define functions in reactive statements | :bulb: |
|
|
387
387
|
| [svelte/no-reactive-literals](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-literals/) | don't assign literal values in reactive statements | :bulb: |
|
|
388
|
+
| [svelte/no-svelte-internal](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-svelte-internal/) | svelte/internal will be removed in Svelte 6. | |
|
|
388
389
|
| [svelte/no-unused-class-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unused-class-name/) | disallow the use of a class in the template without a corresponding style | |
|
|
389
390
|
| [svelte/no-unused-svelte-ignore](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unused-svelte-ignore/) | disallow unused svelte-ignore comments | :star: |
|
|
390
391
|
| [svelte/no-useless-mustaches](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-useless-mustaches/) | disallow unnecessary mustache interpolations | :wrench: |
|
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.39.0";
|
package/lib/meta.js
CHANGED
package/lib/rule-types.d.ts
CHANGED
|
@@ -202,6 +202,11 @@ export interface RuleOptions {
|
|
|
202
202
|
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-store-async/
|
|
203
203
|
*/
|
|
204
204
|
'svelte/no-store-async'?: Linter.RuleEntry<[]>;
|
|
205
|
+
/**
|
|
206
|
+
* svelte/internal will be removed in Svelte 6.
|
|
207
|
+
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-svelte-internal/
|
|
208
|
+
*/
|
|
209
|
+
'svelte/no-svelte-internal'?: Linter.RuleEntry<[]>;
|
|
205
210
|
/**
|
|
206
211
|
* disallow `target="_blank"` attribute without `rel="noopener noreferrer"`
|
|
207
212
|
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-target-blank/
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
exports.default = (0, utils_1.createRule)('no-svelte-internal', {
|
|
5
|
+
meta: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'svelte/internal will be removed in Svelte 6.',
|
|
8
|
+
category: 'Best Practices',
|
|
9
|
+
// TODO Switch to recommended in the major version.
|
|
10
|
+
// recommended: true,
|
|
11
|
+
recommended: false
|
|
12
|
+
},
|
|
13
|
+
schema: [],
|
|
14
|
+
messages: {
|
|
15
|
+
unexpected: 'Using svelte/internal is prohibited. This will be removed in Svelte 6.'
|
|
16
|
+
},
|
|
17
|
+
type: 'problem'
|
|
18
|
+
},
|
|
19
|
+
create(context) {
|
|
20
|
+
function report(node) {
|
|
21
|
+
context.report({
|
|
22
|
+
node,
|
|
23
|
+
messageId: 'unexpected'
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function isSvelteInternal(value) {
|
|
27
|
+
return value === 'svelte/internal' || value.startsWith('svelte/internal/');
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
ImportDeclaration(node) {
|
|
31
|
+
if (node.source && isSvelteInternal(node.source.value)) {
|
|
32
|
+
report(node);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
ImportExpression(node) {
|
|
36
|
+
if (node.source &&
|
|
37
|
+
node.source.type === 'Literal' &&
|
|
38
|
+
typeof node.source.value === 'string' &&
|
|
39
|
+
isSvelteInternal(node.source.value)) {
|
|
40
|
+
report(node);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
ExportNamedDeclaration(node) {
|
|
44
|
+
if (node.source && isSvelteInternal(node.source.value)) {
|
|
45
|
+
report(node);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
ExportAllDeclaration(node) {
|
|
49
|
+
if (node.source && isSvelteInternal(node.source.value)) {
|
|
50
|
+
report(node);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
package/lib/utils/rules.js
CHANGED
|
@@ -43,6 +43,7 @@ const no_restricted_html_elements_1 = __importDefault(require("../rules/no-restr
|
|
|
43
43
|
const no_shorthand_style_property_overrides_1 = __importDefault(require("../rules/no-shorthand-style-property-overrides"));
|
|
44
44
|
const no_spaces_around_equal_signs_in_attribute_1 = __importDefault(require("../rules/no-spaces-around-equal-signs-in-attribute"));
|
|
45
45
|
const no_store_async_1 = __importDefault(require("../rules/no-store-async"));
|
|
46
|
+
const no_svelte_internal_1 = __importDefault(require("../rules/no-svelte-internal"));
|
|
46
47
|
const no_target_blank_1 = __importDefault(require("../rules/no-target-blank"));
|
|
47
48
|
const no_trailing_spaces_1 = __importDefault(require("../rules/no-trailing-spaces"));
|
|
48
49
|
const no_unknown_style_directive_property_1 = __importDefault(require("../rules/no-unknown-style-directive-property"));
|
|
@@ -106,6 +107,7 @@ exports.rules = [
|
|
|
106
107
|
no_shorthand_style_property_overrides_1.default,
|
|
107
108
|
no_spaces_around_equal_signs_in_attribute_1.default,
|
|
108
109
|
no_store_async_1.default,
|
|
110
|
+
no_svelte_internal_1.default,
|
|
109
111
|
no_target_blank_1.default,
|
|
110
112
|
no_trailing_spaces_1.default,
|
|
111
113
|
no_unknown_style_directive_property_1.default,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-svelte",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.39.0",
|
|
4
4
|
"description": "ESLint plugin for Svelte using AST",
|
|
5
5
|
"repository": "git+https://github.com/sveltejs/eslint-plugin-svelte.git",
|
|
6
6
|
"homepage": "https://sveltejs.github.io/eslint-plugin-svelte",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"debug": "^4.3.4",
|
|
42
42
|
"eslint-compat-utils": "^0.5.0",
|
|
43
43
|
"esutils": "^2.0.3",
|
|
44
|
-
"known-css-properties": "^0.
|
|
44
|
+
"known-css-properties": "^0.31.0",
|
|
45
45
|
"postcss": "^8.4.38",
|
|
46
46
|
"postcss-load-config": "^3.1.4",
|
|
47
47
|
"postcss-safe-parser": "^6.0.0",
|
|
48
48
|
"postcss-selector-parser": "^6.0.16",
|
|
49
49
|
"semver": "^7.6.0",
|
|
50
|
-
"svelte-eslint-parser": ">=0.
|
|
50
|
+
"svelte-eslint-parser": ">=0.36.0 <1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@1stg/browserslist-config": "^2.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/less": "^3.0.6",
|
|
79
79
|
"@types/markdown-it": "^14.0.1",
|
|
80
80
|
"@types/markdown-it-container": "^2.0.10",
|
|
81
|
-
"@types/markdown-it-emoji": "^
|
|
81
|
+
"@types/markdown-it-emoji": "^3.0.0",
|
|
82
82
|
"@types/mocha": "^10.0.6",
|
|
83
83
|
"@types/node": "^20.12.7",
|
|
84
84
|
"@types/postcss-safe-parser": "^5.0.4",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"assert": "^2.1.0",
|
|
93
93
|
"cross-spawn": "^7.0.3",
|
|
94
94
|
"env-cmd": "^10.1.0",
|
|
95
|
-
"esbuild": "^0.
|
|
95
|
+
"esbuild": "^0.21.0",
|
|
96
96
|
"esbuild-register": "^3.5.0",
|
|
97
97
|
"escape-html": "^1.0.3",
|
|
98
98
|
"eslint": "^9.0.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"eslint-plugin-jsdoc": "^48.2.3",
|
|
103
103
|
"eslint-plugin-json-schema-validator": "^5.1.0",
|
|
104
104
|
"eslint-plugin-jsonc": "^2.15.1",
|
|
105
|
-
"eslint-plugin-markdown": "^
|
|
105
|
+
"eslint-plugin-markdown": "^5.0.0",
|
|
106
106
|
"eslint-plugin-mdx": "^3.1.5",
|
|
107
107
|
"eslint-plugin-n": "^17.2.1",
|
|
108
108
|
"eslint-plugin-node-dependencies": "^0.12.0",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"rimraf": "^5.0.5",
|
|
136
136
|
"sass": "^1.75.0",
|
|
137
137
|
"source-map-js": "^1.2.0",
|
|
138
|
-
"stylelint": "~16.
|
|
138
|
+
"stylelint": "~16.5.0",
|
|
139
139
|
"stylelint-config-standard": "^36.0.0",
|
|
140
140
|
"stylus": "^0.63.0",
|
|
141
141
|
"svelte": "^5.0.0-next.112",
|