Skip to content

feat(valid-prop-names-in-kit-pages): support params page prop #1268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2025
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/strange-actors-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-svelte": patch
---

feat(valid-prop-names-in-kit-pages): add support for the new `params` page prop
1 change: 1 addition & 0 deletions docs/rules/valid-prop-names-in-kit-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ At SvelteKit v1.0.0-next.405, instead of having multiple props corresponding to
export let data;
export let errors;
export let form;
export let params;
export let snapshot;
// export let { data, errors } = { data: {}, errors: {} }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createRule } from '../utils/index.js';
import type { RuleContext } from '../types.js';
import { getSvelteVersion } from '../utils/svelte-context.js';

const EXPECTED_PROP_NAMES = ['data', 'errors', 'form', 'snapshot'];
const EXPECTED_PROP_NAMES = ['data', 'errors', 'form', 'params', 'snapshot'];
const EXPECTED_PROP_NAMES_SVELTE5 = [...EXPECTED_PROP_NAMES, 'children'];

function checkProp(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
let { data, errors, form, children } = $props();
let { data, errors, form, params, children } = $props();

let comment = '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export let data;
export let errors;
export let form;
export let params;

let comment = '';

Expand Down
Loading