Skip to content

Files

Latest commit

 

History

History
58 lines (42 loc) · 1.4 KB

valid-prop-names-in-kit-pages.md

File metadata and controls

58 lines (42 loc) · 1.4 KB

Pattern: Unexpected exported variables at <script>

Issue: -

Description

This rule reports unexpected exported variables at <script>. At SvelteKit v1.0.0-next.405, instead of having multiple props corresponding to the props returned from a load function, page components now have a single data prop.

<script> const config = {settings: { kit: { files: { routes: "", }, }, }, } </script>
<script>
  /* eslint svelte/valid-prop-names-in-kit-pages: "error" */
  /** ✓ GOOD */
  export let data;
  export let errors;
  export let form;
  export let snapshot;
  // export let { data, errors } = { data: {}, errors: {} }

  /** ✗ BAD */
  export let foo;
  export let bar;
  export let { baz, qux } = data;
  export let { data: data2, errors: errors2 } = { data: {}, errors: {} };
</script>

{foo}, {bar}

🔧 Options

Nothing.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-svelte v2.12.0

🔍 Implementation