-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f79fded
commit 513806c
Showing
11 changed files
with
183 additions
and
35 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': patch | ||
--- | ||
|
||
fix: allow `children` in `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
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
5 changes: 5 additions & 0 deletions
5
.../tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte4-children/+page.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> | ||
export let children; | ||
</script> | ||
|
||
{children} |
13 changes: 13 additions & 0 deletions
13
.../tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte4-children/_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/svelte4-children" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...e/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte4-children/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,4 @@ | ||
- message: disallow props other than data or errors in SvelteKit page components. | ||
line: 2 | ||
column: 13 | ||
suggestions: null |
3 changes: 3 additions & 0 deletions
3
...s/fixtures/rules/valid-prop-names-in-kit-pages/invalid/svelte4-children/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" | ||
} |
24 changes: 24 additions & 0 deletions
24
...sts/fixtures/rules/valid-prop-names-in-kit-pages/valid/svelte5-without-runes/+page.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,24 @@ | ||
<script> | ||
export let data; | ||
export let errors; | ||
export let form; | ||
export let children; | ||
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> |
Oops, something went wrong.