diff --git a/.changeset/grumpy-deers-film.md b/.changeset/grumpy-deers-film.md new file mode 100644 index 000000000..7ac817861 --- /dev/null +++ b/.changeset/grumpy-deers-film.md @@ -0,0 +1,5 @@ +--- +'eslint-plugin-svelte': patch +--- + +chore: change the rule category of `no-export-load-in-svelte-module-in-kit-pages` to `SvelteKit` diff --git a/README.md b/README.md index 5caad4691..9f3165fd6 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,6 @@ These rules relate to possible syntax or logic errors in Svelte code: | [svelte/no-dupe-style-properties](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-style-properties/) | disallow duplicate style properties | :star: | | [svelte/no-dupe-use-directives](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-use-directives/) | disallow duplicate `use:` directives | | | [svelte/no-dynamic-slot-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/) | disallow dynamic slot name | :star::wrench: | -| [svelte/no-export-load-in-svelte-module-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | | [svelte/no-not-function-handler](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/) | disallow use of not function in event handler | :star: | | [svelte/no-object-in-text-mustaches](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches/) | disallow objects in text mustache interpolation | :star: | | [svelte/no-raw-special-elements](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-raw-special-elements/) | Checks for invalid raw HTML elements | :wrench: | @@ -416,6 +415,7 @@ These rules relate to SvelteKit and its best Practices. | Rule ID | Description | | |:--------|:------------|:---| +| [svelte/no-export-load-in-svelte-module-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | | [svelte/no-navigation-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-navigation-without-base/) | disallow using navigation (links, goto, pushState, replaceState) without the base path | | ## Experimental diff --git a/docs/rules.md b/docs/rules.md index 73dcbdf8b..ddd0d5929 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -14,27 +14,26 @@ sidebarDepth: 0 These rules relate to possible syntax or logic errors in Svelte code: -| Rule ID | Description | | -| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :------------- | -| [svelte/infinite-reactive-loop](./rules/infinite-reactive-loop.md) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | | -| [svelte/no-dom-manipulating](./rules/no-dom-manipulating.md) | disallow DOM manipulating | | -| [svelte/no-dupe-else-if-blocks](./rules/no-dupe-else-if-blocks.md) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: | -| [svelte/no-dupe-on-directives](./rules/no-dupe-on-directives.md) | disallow duplicate `on:` directives | | -| [svelte/no-dupe-style-properties](./rules/no-dupe-style-properties.md) | disallow duplicate style properties | :star: | -| [svelte/no-dupe-use-directives](./rules/no-dupe-use-directives.md) | disallow duplicate `use:` directives | | -| [svelte/no-dynamic-slot-name](./rules/no-dynamic-slot-name.md) | disallow dynamic slot name | :star::wrench: | -| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | -| [svelte/no-not-function-handler](./rules/no-not-function-handler.md) | disallow use of not function in event handler | :star: | -| [svelte/no-object-in-text-mustaches](./rules/no-object-in-text-mustaches.md) | disallow objects in text mustache interpolation | :star: | -| [svelte/no-raw-special-elements](./rules/no-raw-special-elements.md) | Checks for invalid raw HTML elements | :wrench: | -| [svelte/no-reactive-reassign](./rules/no-reactive-reassign.md) | disallow reassigning reactive values | | -| [svelte/no-shorthand-style-property-overrides](./rules/no-shorthand-style-property-overrides.md) | disallow shorthand style properties that override related longhand properties | :star: | -| [svelte/no-store-async](./rules/no-store-async.md) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | | -| [svelte/no-unknown-style-directive-property](./rules/no-unknown-style-directive-property.md) | disallow unknown `style:property` | :star: | -| [svelte/require-store-callbacks-use-set-param](./rules/require-store-callbacks-use-set-param.md) | store callbacks must use `set` param | | -| [svelte/require-store-reactive-access](./rules/require-store-reactive-access.md) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: | -| [svelte/valid-compile](./rules/valid-compile.md) | disallow warnings when compiling. | :star: | -| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in SvelteKit page components. | | +| Rule ID | Description | | +| :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :------------- | +| [svelte/infinite-reactive-loop](./rules/infinite-reactive-loop.md) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | | +| [svelte/no-dom-manipulating](./rules/no-dom-manipulating.md) | disallow DOM manipulating | | +| [svelte/no-dupe-else-if-blocks](./rules/no-dupe-else-if-blocks.md) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: | +| [svelte/no-dupe-on-directives](./rules/no-dupe-on-directives.md) | disallow duplicate `on:` directives | | +| [svelte/no-dupe-style-properties](./rules/no-dupe-style-properties.md) | disallow duplicate style properties | :star: | +| [svelte/no-dupe-use-directives](./rules/no-dupe-use-directives.md) | disallow duplicate `use:` directives | | +| [svelte/no-dynamic-slot-name](./rules/no-dynamic-slot-name.md) | disallow dynamic slot name | :star::wrench: | +| [svelte/no-not-function-handler](./rules/no-not-function-handler.md) | disallow use of not function in event handler | :star: | +| [svelte/no-object-in-text-mustaches](./rules/no-object-in-text-mustaches.md) | disallow objects in text mustache interpolation | :star: | +| [svelte/no-raw-special-elements](./rules/no-raw-special-elements.md) | Checks for invalid raw HTML elements | :wrench: | +| [svelte/no-reactive-reassign](./rules/no-reactive-reassign.md) | disallow reassigning reactive values | | +| [svelte/no-shorthand-style-property-overrides](./rules/no-shorthand-style-property-overrides.md) | disallow shorthand style properties that override related longhand properties | :star: | +| [svelte/no-store-async](./rules/no-store-async.md) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | | +| [svelte/no-unknown-style-directive-property](./rules/no-unknown-style-directive-property.md) | disallow unknown `style:property` | :star: | +| [svelte/require-store-callbacks-use-set-param](./rules/require-store-callbacks-use-set-param.md) | store callbacks must use `set` param | | +| [svelte/require-store-reactive-access](./rules/require-store-reactive-access.md) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: | +| [svelte/valid-compile](./rules/valid-compile.md) | disallow warnings when compiling. | :star: | +| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in SvelteKit page components. | | ## Security Vulnerability @@ -111,9 +110,10 @@ These rules extend the rules provided by ESLint itself, or other plugins to work These rules relate to SvelteKit and its best Practices. -| Rule ID | Description | | -| :------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :-- | -| [svelte/no-navigation-without-base](./rules/no-navigation-without-base.md) | disallow using navigation (links, goto, pushState, replaceState) without the base path | | +| Rule ID | Description | | +| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :-- | +| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | +| [svelte/no-navigation-without-base](./rules/no-navigation-without-base.md) | disallow using navigation (links, goto, pushState, replaceState) without the base path | | ## Experimental diff --git a/packages/eslint-plugin-svelte/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts b/packages/eslint-plugin-svelte/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts index 3db86fefd..0a39a4e80 100644 --- a/packages/eslint-plugin-svelte/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts +++ b/packages/eslint-plugin-svelte/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts @@ -6,7 +6,7 @@ export default createRule('no-export-load-in-svelte-module-in-kit-pages', { docs: { description: 'disallow exporting load functions in `*.svelte` module in SvelteKit page components.', - category: 'Possible Errors', + category: 'SvelteKit', // TODO Switch to recommended in the major version. recommended: false },