-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: (experimental) partial support for Svelte v5 (#620)
- Loading branch information
Showing
59 changed files
with
306 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-svelte": minor | ||
--- | ||
|
||
feat: (experimental) partial support for Svelte v5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "next", | ||
"initialVersions": { | ||
"eslint-plugin-svelte": "2.35.0" | ||
}, | ||
"changesets": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,5 @@ name | |
/await | ||
} | ||
</div> | ||
|
||
<!--tests/fixtures/rules/indent/invalid/await01-input.svelte--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,5 @@ | |
/await | ||
} | ||
</div> | ||
|
||
<!--tests/fixtures/rules/indent/invalid/await01-input.svelte--> |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/indent/invalid/await01-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,5 @@ | |
|
||
{ #key expression }...{ /key } | ||
</div> | ||
|
||
<!--tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,5 @@ | |
|
||
{#key expression}...{/key} | ||
</div> | ||
|
||
<!--tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte--> |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/test01-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
6 changes: 1 addition & 5 deletions
6
tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
- message: svelte-ignore comment is used, but not warned | ||
line: 3 | ||
column: 19 | ||
suggestions: null | ||
- message: svelte-ignore comment is used, but not warned | ||
line: 5 | ||
line: 4 | ||
column: 19 | ||
suggestions: null |
14 changes: 8 additions & 6 deletions
14
tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<script> | ||
let foo; | ||
// svelte-ignore unused-export-let | ||
export let used; | ||
// svelte-ignore module-script-reactive-declaration | ||
$: reactive = foo; | ||
// svelte-ignore state-rune-not-mutated | ||
let mutable = $state(42); | ||
// svelte-ignore state-rune-not-mutated | ||
let immutable = $state(42); | ||
export function update(a) { | ||
immutable = a; | ||
} | ||
</script> | ||
|
||
{used} | ||
{mutable}{immutable} |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- message: svelte-ignore comment is used, but not warned | ||
line: 3 | ||
column: 19 | ||
suggestions: null | ||
- message: svelte-ignore comment is used, but not warned | ||
line: 5 | ||
column: 19 | ||
suggestions: null |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
let foo; | ||
// svelte-ignore unused-export-let | ||
export let used; | ||
// svelte-ignore module-script-reactive-declaration | ||
$: reactive = foo; | ||
</script> | ||
|
||
{used} |
3 changes: 3 additions & 0 deletions
3
...fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": "^3.0.0 || ^4.0.0" | ||
} |
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": "^3.0.0 || ^4.0.0" | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": "^3.0.0 || ^4.0.0" | ||
} |
12 changes: 4 additions & 8 deletions
12
tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
<script context="module"> | ||
let foo; | ||
</script> | ||
|
||
<script> | ||
// svelte-ignore unused-export-let | ||
export let unused; | ||
// svelte-ignore module-script-reactive-declaration | ||
$: reactive = foo; | ||
// svelte-ignore state-rune-not-mutated | ||
let immutable = $state(42); | ||
</script> | ||
|
||
{immutable} |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script context="module"> | ||
let foo; | ||
</script> | ||
|
||
<script> | ||
// svelte-ignore unused-export-let | ||
export let unused; | ||
// svelte-ignore module-script-reactive-declaration | ||
$: reactive = foo; | ||
</script> |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": "^3.0.0 || ^4.0.0" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang01-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang02-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang03-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang04-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang05-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang06-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", | ||
"svelte": "^4 || ^3" | ||
} |
12 changes: 9 additions & 3 deletions
12
tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
<script lang="ts"> | ||
// svelte-ignore unused-export-let | ||
export let something; | ||
<script> | ||
let mutable = $state(42); | ||
// svelte-ignore state-rune-not-mutated | ||
let immutable = $state(42); | ||
export function update(a) { | ||
mutable = a; | ||
} | ||
</script> | ||
|
||
{mutable}{immutable} |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<script lang="ts"> | ||
// svelte-ignore unused-export-let | ||
export let something; | ||
</script> |
Oops, something went wrong.