Skip to content

Commit 527c64d

Browse files
committed
chore: removed Svelte 4 specific rules from recommended set
1 parent 2bd1799 commit 527c64d

11 files changed

+30
-33
lines changed

.changeset/green-cherries-fail.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-plugin-svelte': major
3+
---
4+
5+
chore: removed Svelte 4 specific rules from recommended set

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ These rules relate to possible syntax or logic errors in Svelte code:
326326
| [svelte/no-dupe-on-directives](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-on-directives/) | disallow duplicate `on:` directives | |
327327
| [svelte/no-dupe-style-properties](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-style-properties/) | disallow duplicate style properties | :star: |
328328
| [svelte/no-dupe-use-directives](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-use-directives/) | disallow duplicate `use:` directives | |
329-
| [svelte/no-dynamic-slot-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/) | disallow dynamic slot name | :star::wrench: |
329+
| [svelte/no-dynamic-slot-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/) | disallow dynamic slot name | :wrench: |
330330
| [svelte/no-export-load-in-svelte-module-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | |
331-
| [svelte/no-not-function-handler](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/) | disallow use of not function in event handler | :star: |
331+
| [svelte/no-not-function-handler](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/) | disallow use of not function in event handler | |
332332
| [svelte/no-object-in-text-mustaches](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches/) | disallow objects in text mustache interpolation | :star: |
333333
| [svelte/no-reactive-reassign](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-reassign/) | disallow reassigning reactive values | |
334334
| [svelte/no-shorthand-style-property-overrides](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-shorthand-style-property-overrides/) | disallow shorthand style properties that override related longhand properties | :star: |

docs/rules.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ sidebarDepth: 0
1414

1515
These rules relate to possible syntax or logic errors in Svelte code:
1616

17-
| Rule ID | Description | |
18-
| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :------------- |
19-
| [svelte/infinite-reactive-loop](./rules/infinite-reactive-loop.md) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | |
20-
| [svelte/no-deprecated-raw-special-elements](./rules/no-deprecated-raw-special-elements.md) | Recommends not using raw special elements in Svelte versions previous to 5. | :wrench: |
21-
| [svelte/no-dom-manipulating](./rules/no-dom-manipulating.md) | disallow DOM manipulating | |
22-
| [svelte/no-dupe-else-if-blocks](./rules/no-dupe-else-if-blocks.md) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: |
23-
| [svelte/no-dupe-on-directives](./rules/no-dupe-on-directives.md) | disallow duplicate `on:` directives | |
24-
| [svelte/no-dupe-style-properties](./rules/no-dupe-style-properties.md) | disallow duplicate style properties | :star: |
25-
| [svelte/no-dupe-use-directives](./rules/no-dupe-use-directives.md) | disallow duplicate `use:` directives | |
26-
| [svelte/no-dynamic-slot-name](./rules/no-dynamic-slot-name.md) | disallow dynamic slot name | :star::wrench: |
27-
| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | |
28-
| [svelte/no-not-function-handler](./rules/no-not-function-handler.md) | disallow use of not function in event handler | :star: |
29-
| [svelte/no-object-in-text-mustaches](./rules/no-object-in-text-mustaches.md) | disallow objects in text mustache interpolation | :star: |
30-
| [svelte/no-reactive-reassign](./rules/no-reactive-reassign.md) | disallow reassigning reactive values | |
31-
| [svelte/no-shorthand-style-property-overrides](./rules/no-shorthand-style-property-overrides.md) | disallow shorthand style properties that override related longhand properties | :star: |
32-
| [svelte/no-store-async](./rules/no-store-async.md) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | |
33-
| [svelte/no-unknown-style-directive-property](./rules/no-unknown-style-directive-property.md) | disallow unknown `style:property` | :star: |
34-
| [svelte/require-store-callbacks-use-set-param](./rules/require-store-callbacks-use-set-param.md) | store callbacks must use `set` param | |
35-
| [svelte/require-store-reactive-access](./rules/require-store-reactive-access.md) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: |
36-
| [svelte/valid-compile](./rules/valid-compile.md) | disallow warnings when compiling. | :star: |
37-
| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in SvelteKit page components. | |
17+
| Rule ID | Description | |
18+
| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :------- |
19+
| [svelte/infinite-reactive-loop](./rules/infinite-reactive-loop.md) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | |
20+
| [svelte/no-deprecated-raw-special-elements](./rules/no-deprecated-raw-special-elements.md) | Recommends not using raw special elements in Svelte versions previous to 5. | :wrench: |
21+
| [svelte/no-dom-manipulating](./rules/no-dom-manipulating.md) | disallow DOM manipulating | |
22+
| [svelte/no-dupe-else-if-blocks](./rules/no-dupe-else-if-blocks.md) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: |
23+
| [svelte/no-dupe-on-directives](./rules/no-dupe-on-directives.md) | disallow duplicate `on:` directives | |
24+
| [svelte/no-dupe-style-properties](./rules/no-dupe-style-properties.md) | disallow duplicate style properties | :star: |
25+
| [svelte/no-dupe-use-directives](./rules/no-dupe-use-directives.md) | disallow duplicate `use:` directives | |
26+
| [svelte/no-dynamic-slot-name](./rules/no-dynamic-slot-name.md) | disallow dynamic slot name | :wrench: |
27+
| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | |
28+
| [svelte/no-not-function-handler](./rules/no-not-function-handler.md) | disallow use of not function in event handler | |
29+
| [svelte/no-object-in-text-mustaches](./rules/no-object-in-text-mustaches.md) | disallow objects in text mustache interpolation | :star: |
30+
| [svelte/no-reactive-reassign](./rules/no-reactive-reassign.md) | disallow reassigning reactive values | |
31+
| [svelte/no-shorthand-style-property-overrides](./rules/no-shorthand-style-property-overrides.md) | disallow shorthand style properties that override related longhand properties | :star: |
32+
| [svelte/no-store-async](./rules/no-store-async.md) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | |
33+
| [svelte/no-unknown-style-directive-property](./rules/no-unknown-style-directive-property.md) | disallow unknown `style:property` | :star: |
34+
| [svelte/require-store-callbacks-use-set-param](./rules/require-store-callbacks-use-set-param.md) | store callbacks must use `set` param | |
35+
| [svelte/require-store-reactive-access](./rules/require-store-reactive-access.md) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: |
36+
| [svelte/valid-compile](./rules/valid-compile.md) | disallow warnings when compiling. | :star: |
37+
| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in SvelteKit page components. | |
3838

3939
## Security Vulnerability
4040

docs/rules/no-dynamic-slot-name.md

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ since: 'v0.14.0'
1010

1111
> disallow dynamic slot name
1212
13-
- :gear: This rule is included in `"plugin:svelte/recommended"`.
1413
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
1514

1615
## :book: Rule Details

docs/rules/no-not-function-handler.md

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ since: 'v0.5.0'
1010

1111
> disallow use of not function in event handler
1212
13-
- :gear: This rule is included in `"plugin:svelte/recommended"`.
14-
1513
## :book: Rule Details
1614

1715
This rule reports where you used not function value in event handlers.

packages/eslint-plugin-svelte/src/configs/flat/recommended.ts

-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ const config: Linter.Config[] = [
1414
'svelte/no-at-html-tags': 'error',
1515
'svelte/no-dupe-else-if-blocks': 'error',
1616
'svelte/no-dupe-style-properties': 'error',
17-
'svelte/no-dynamic-slot-name': 'error',
1817
'svelte/no-inner-declarations': 'error',
19-
'svelte/no-not-function-handler': 'error',
2018
'svelte/no-object-in-text-mustaches': 'error',
2119
'svelte/no-shorthand-style-property-overrides': 'error',
2220
'svelte/no-unknown-style-directive-property': 'error',

packages/eslint-plugin-svelte/src/rules/infinite-reactive-loop.ts

-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ export default createRule('infinite-reactive-loop', {
369369
description:
370370
"Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent.",
371371
category: 'Possible Errors',
372-
// TODO Switch to recommended in the major version.
373372
recommended: false
374373
},
375374
schema: [],

packages/eslint-plugin-svelte/src/rules/no-dynamic-slot-name.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default createRule('no-dynamic-slot-name', {
1313
docs: {
1414
description: 'disallow dynamic slot name',
1515
category: 'Possible Errors',
16-
recommended: true
16+
recommended: false
1717
},
1818
fixable: 'code',
1919
schema: [],

packages/eslint-plugin-svelte/src/rules/no-immutable-reactive-statements.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default createRule('no-immutable-reactive-statements', {
1010
docs: {
1111
description: "disallow reactive statements that don't reference reactive values.",
1212
category: 'Best Practices',
13-
// TODO Switch to recommended in the major version.
1413
recommended: false
1514
},
1615
schema: [],

packages/eslint-plugin-svelte/src/rules/no-not-function-handler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default createRule('no-not-function-handler', {
2626
docs: {
2727
description: 'disallow use of not function in event handler',
2828
category: 'Possible Errors',
29-
recommended: true
29+
recommended: false
3030
},
3131
schema: [],
3232
messages: {

packages/eslint-plugin-svelte/src/rules/no-reactive-reassign.ts

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default createRule('no-reactive-reassign', {
99
docs: {
1010
description: 'disallow reassigning reactive values',
1111
category: 'Possible Errors',
12-
// TODO Switch to recommended in the major version.
1312
recommended: false
1413
},
1514
schema: [

0 commit comments

Comments
 (0)