Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-guests-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-svelte': patch
---

fix: check property key instead of value in `valid-prop-names-in-kit-pages` rule
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function checkProp(
for (const p of node.id.properties) {
if (
p.type === 'Property' &&
p.value.type === 'Identifier' &&
!expectedPropNames.includes(p.value.name)
p.key.type === 'Identifier' &&
!expectedPropNames.includes(p.key.name)
) {
context.report({
node: p.value,
loc: p.value.loc,
node: p.key,
loc: p.key.loc,
messageId: 'unexpected'
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@
line: 4
column: 20
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 21
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 36
suggestions: null
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@
line: 4
column: 20
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 21
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 36
suggestions: null
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@
line: 4
column: 20
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 21
suggestions: null
- message: disallow props other than data or errors in SvelteKit page components.
line: 5
column: 36
suggestions: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script lang="ts">
let { data: pageData }: { data: PageData } = $props();
</script>

{pageData}
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"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"svelte": ">=5.0.0-0"
}