-
-
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: support Svelte5 of
valid-prop-names-in-kit-pages
rule (#963)
- Loading branch information
1 parent
4a20331
commit 2c551b2
Showing
11 changed files
with
113 additions
and
13 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: support Svelte5 of `valid-prop-names-in-kit-pages` rule |
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
8 changes: 8 additions & 0 deletions
8
...fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte5/+svelte5-test001-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: disallow props other than data or errors in SvelteKit page components. | ||
line: 2 | ||
column: 8 | ||
suggestions: null | ||
- message: disallow props other than data or errors in SvelteKit page components. | ||
line: 2 | ||
column: 13 | ||
suggestions: null |
5 changes: 5 additions & 0 deletions
5
...ixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte5/+svelte5-test001-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,5 @@ | ||
<script> | ||
let { foo, bar } = $props(); | ||
</script> | ||
|
||
{foo}, {bar} |
3 changes: 3 additions & 0 deletions
3
...es/rules/valid-prop-names-in-kit-pages/invalid/svelte5/+svelte5-test001-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" | ||
} |
13 changes: 13 additions & 0 deletions
13
...in-svelte/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte5/_config.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,13 @@ | ||
{ | ||
"languageOptions": { | ||
"parserOptions": { | ||
"svelteConfig": { | ||
"kit": { | ||
"files": { | ||
"routes": "tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte5" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...s/fixtures/rules/valid-prop-names-in-kit-pages/valid/not-page/svelte5/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
let { data, errors, foo, bar } = $props(); | ||
</script> | ||
|
||
{data}, {errors}, {foo}, {bar} |
3 changes: 3 additions & 0 deletions
3
...tures/rules/valid-prop-names-in-kit-pages/valid/not-page/svelte5/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,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
21 changes: 21 additions & 0 deletions
21
...te/tests/fixtures/rules/valid-prop-names-in-kit-pages/valid/svelte5/+test001-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,21 @@ | ||
<script> | ||
let { data, errors, form } = $props(); | ||
let comment = ''; | ||
export const snapshot = { | ||
capture: () => comment, | ||
restore: (value) => (comment = value) | ||
}; | ||
</script> | ||
|
||
{data}, {errors} | ||
|
||
{#if form?.success} | ||
<p>Successfully logged in! Welcome back, {data.user.name}</p> | ||
{/if} | ||
|
||
<form method="POST"> | ||
<textarea bind:value={comment} /> | ||
<button>Post comment</button> | ||
</form> |
3 changes: 3 additions & 0 deletions
3
...sts/fixtures/rules/valid-prop-names-in-kit-pages/valid/svelte5/+test001-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" | ||
} |
13 changes: 13 additions & 0 deletions
13
...ugin-svelte/tests/fixtures/rules/valid-prop-names-in-kit-pages/valid/svelte5/_config.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,13 @@ | ||
{ | ||
"languageOptions": { | ||
"parserOptions": { | ||
"svelteConfig": { | ||
"kit": { | ||
"files": { | ||
"routes": "tests/fixtures/rules/valid-prop-names-in-kit-pages/valid/svelte5" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |