eslint-plugin-svelte 3.0.1 → 3.0.2
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 -1
- package/lib/main.d.ts +1 -1
- package/lib/meta.d.ts +1 -1
- package/lib/meta.js +1 -1
- package/lib/rules/valid-prop-names-in-kit-pages.js +13 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -238,7 +238,7 @@ If you’re migrating from `eslint-plugin-svelte` v1 or [`@ota-meshi/eslint-plug
|
|
|
238
238
|
|
|
239
239
|
## Versioning Policy
|
|
240
240
|
|
|
241
|
-
This project follows [Semantic Versioning](https://semver.org/). Unlike [ESLint’s versioning policy](https://github.com/eslint/eslint#semantic-versioning-policy), new rules may be added in minor releases. If these
|
|
241
|
+
This project follows [Semantic Versioning](https://semver.org/). Unlike [ESLint’s versioning policy](https://github.com/eslint/eslint#semantic-versioning-policy), new rules may be added to the recommended config in minor releases. If these rules cause unwanted warnings, you can disable them.
|
|
242
242
|
|
|
243
243
|
<!--DOCS_IGNORE_END-->
|
|
244
244
|
|
package/lib/main.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const configs: {
|
|
|
14
14
|
export declare const rules: Record<string, Rule.RuleModule>;
|
|
15
15
|
export declare const meta: {
|
|
16
16
|
name: "eslint-plugin-svelte";
|
|
17
|
-
version: "3.0.
|
|
17
|
+
version: "3.0.2";
|
|
18
18
|
};
|
|
19
19
|
export declare const processors: {
|
|
20
20
|
'.svelte': typeof processor;
|
package/lib/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "eslint-plugin-svelte";
|
|
2
|
-
export declare const version = "3.0.
|
|
2
|
+
export declare const version = "3.0.2";
|
package/lib/meta.js
CHANGED
|
@@ -17,6 +17,18 @@ function checkProp(node, context, expectedPropNames) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
function isModuleScript(node) {
|
|
21
|
+
// <script context="module">
|
|
22
|
+
if (node.key.name === 'context' &&
|
|
23
|
+
node.value.some((v) => v.type === 'SvelteLiteral' && v.value === 'module')) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
// <script module>
|
|
27
|
+
if (node.key.name === 'module' && node.value.length === 0) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
20
32
|
export default createRule('valid-prop-names-in-kit-pages', {
|
|
21
33
|
meta: {
|
|
22
34
|
docs: {
|
|
@@ -43,9 +55,7 @@ export default createRule('valid-prop-names-in-kit-pages', {
|
|
|
43
55
|
// <script>
|
|
44
56
|
'Program > SvelteScriptElement > SvelteStartTag': (node) => {
|
|
45
57
|
// except for <script context="module">
|
|
46
|
-
isScript = !node.attributes.some((a) => a.type === 'SvelteAttribute' &&
|
|
47
|
-
a.key.name === 'context' &&
|
|
48
|
-
a.value.some((v) => v.type === 'SvelteLiteral' && v.value === 'module'));
|
|
58
|
+
isScript = !node.attributes.some((a) => a.type === 'SvelteAttribute' && isModuleScript(a));
|
|
49
59
|
},
|
|
50
60
|
// </script>
|
|
51
61
|
'Program > SvelteScriptElement:exit': () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-svelte",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
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",
|