eslint-plugin-svelte 3.0.1 → 3.0.3

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 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 new rules cause unwanted warnings, you can disable them.
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.1";
17
+ version: "3.0.3";
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.1";
2
+ export declare const version = "3.0.3";
package/lib/meta.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // This file has been automatically generated,
3
3
  // in order to update its content execute "pnpm run update"
4
4
  export const name = 'eslint-plugin-svelte';
5
- export const version = '3.0.1';
5
+ export const version = '3.0.3';
@@ -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.1",
3
+ "version": "3.0.3",
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",
@@ -8,7 +8,7 @@
8
8
  "funding": "https://github.com/sponsors/ota-meshi",
9
9
  "license": "MIT",
10
10
  "engines": {
11
- "node": "^18.20.4 || ^20.18.0 || >=22.10.0"
11
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
12
12
  },
13
13
  "type": "module",
14
14
  "main": "lib/index.js",
@@ -41,7 +41,7 @@
41
41
  "postcss-load-config": "^3.1.4",
42
42
  "postcss-safe-parser": "^7.0.0",
43
43
  "semver": "^7.6.3",
44
- "svelte-eslint-parser": "^1.0.0"
44
+ "svelte-eslint-parser": "^1.0.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@babel/core": "^7.26.0",