From 2abcee4731a6bd9e1873d23f72e66ad59c61f820 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Sun, 21 Jul 2024 18:03:31 +0900 Subject: [PATCH] wip --- README.md | 88 ++++----- docs-svelte-kit/eslint.config.mjs | 10 +- docs-svelte-kit/package.json | 7 +- docs-svelte-kit/src/app.css | 119 ++++++------ docs-svelte-kit/src/lib/server/markdown.ts | 82 +++++++++ docs-svelte-kit/src/routes/+layout.svelte | 4 +- .../src/routes/[slug]/+page.server.ts | 13 ++ .../src/routes/[slug]/+page.svelte | 31 ++++ .../src/routes/[slug]/[slug]/+page.server.ts | 13 ++ .../src/routes/[slug]/[slug]/+page.svelte | 26 +++ docs-svelte-kit/src/site.css | 120 ++++++------ docs-svelte-kit/svelte.config.js | 3 + docs-svelte-kit/tsconfig.json | 2 - docs/README.md | 2 +- docs/rules.md | 172 +++++++++--------- .../no-unnecessary-condition.md | 12 +- docs/rules/block-lang.md | 8 +- docs/rules/button-has-type.md | 8 +- docs/rules/comment-directive.md | 10 +- docs/rules/derived-has-same-inputs-outputs.md | 10 +- docs/rules/experimental-require-slot-types.md | 8 +- .../experimental-require-strict-events.md | 8 +- docs/rules/first-attribute-linebreak.md | 10 +- docs/rules/html-closing-bracket-spacing.md | 10 +- docs/rules/html-quotes.md | 10 +- docs/rules/html-self-closing.md | 10 +- docs/rules/indent.md | 10 +- docs/rules/infinite-reactive-loop.md | 14 +- docs/rules/max-attributes-per-line.md | 10 +- docs/rules/mustache-spacing.md | 10 +- docs/rules/no-at-debug-tags.md | 10 +- docs/rules/no-at-html-tags.md | 10 +- docs/rules/no-dom-manipulating.md | 8 +- docs/rules/no-dupe-else-if-blocks.md | 8 +- docs/rules/no-dupe-on-directives.md | 8 +- docs/rules/no-dupe-style-properties.md | 8 +- docs/rules/no-dupe-use-directives.md | 8 +- docs/rules/no-dynamic-slot-name.md | 10 +- ...port-load-in-svelte-module-in-kit-pages.md | 10 +- docs/rules/no-extra-reactive-curlies.md | 10 +- docs/rules/no-goto-without-base.md | 10 +- docs/rules/no-ignored-unsubscribe.md | 8 +- .../rules/no-immutable-reactive-statements.md | 8 +- docs/rules/no-inline-styles.md | 10 +- docs/rules/no-inner-declarations.md | 8 +- docs/rules/no-not-function-handler.md | 8 +- docs/rules/no-object-in-text-mustaches.md | 8 +- docs/rules/no-reactive-functions.md | 10 +- docs/rules/no-reactive-literals.md | 10 +- docs/rules/no-reactive-reassign.md | 8 +- docs/rules/no-restricted-html-elements.md | 8 +- .../no-shorthand-style-property-overrides.md | 10 +- ...-spaces-around-equal-signs-in-attribute.md | 10 +- docs/rules/no-store-async.md | 10 +- docs/rules/no-svelte-internal.md | 10 +- docs/rules/no-target-blank.md | 8 +- docs/rules/no-trailing-spaces.md | 10 +- .../no-unknown-style-directive-property.md | 10 +- docs/rules/no-unused-class-name.md | 8 +- docs/rules/no-unused-svelte-ignore.md | 10 +- docs/rules/no-useless-mustaches.md | 10 +- docs/rules/prefer-class-directive.md | 12 +- docs/rules/prefer-destructured-store-props.md | 10 +- docs/rules/prefer-style-directive.md | 12 +- docs/rules/require-each-key.md | 10 +- docs/rules/require-event-dispatcher-types.md | 8 +- .../require-optimized-style-attribute.md | 8 +- .../require-store-callbacks-use-set-param.md | 10 +- docs/rules/require-store-reactive-access.md | 10 +- docs/rules/require-stores-init.md | 8 +- docs/rules/shorthand-attribute.md | 10 +- docs/rules/shorthand-directive.md | 10 +- docs/rules/sort-attributes.md | 10 +- docs/rules/spaced-html-comment.md | 10 +- docs/rules/system.md | 8 +- docs/rules/valid-compile.md | 8 +- docs/rules/valid-each-key.md | 10 +- docs/rules/valid-prop-names-in-kit-pages.md | 10 +- docs/user-guide.md | 8 +- .../eslint-plugin-svelte/tools/new-rule.ts | 6 +- .../tools/render-rules.ts | 12 +- .../tools/update-docs-rules-index.ts | 6 +- .../eslint-plugin-svelte/tools/update-docs.ts | 18 +- 83 files changed, 760 insertions(+), 576 deletions(-) create mode 100644 docs-svelte-kit/src/lib/server/markdown.ts create mode 100644 docs-svelte-kit/src/routes/[slug]/+page.server.ts create mode 100644 docs-svelte-kit/src/routes/[slug]/+page.svelte create mode 100644 docs-svelte-kit/src/routes/[slug]/[slug]/+page.server.ts create mode 100644 docs-svelte-kit/src/routes/[slug]/[slug]/+page.svelte diff --git a/README.md b/README.md index 610a270d6..5a16a8666 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ We are working on support for Svelte v5, but it is still an experimental feature To migrate from `eslint-plugin-svelte` v1, or [`@ota-meshi/eslint-plugin-svelte`](https://www.npmjs.com/package/@ota-meshi/eslint-plugin-svelte), please refer to the [migration guide](https://sveltejs.github.io/eslint-plugin-svelte/migration/). -## :book: Documentation +## 📖 Documentation See [documents](https://sveltejs.github.io/eslint-plugin-svelte/). -## :cd: Installation +## 💿 Installation ```bash npm install --save-dev eslint eslint-plugin-svelte svelte @@ -61,7 +61,7 @@ npm install --save-dev eslint eslint-plugin-svelte svelte -## :book: Usage +## 📖 Usage @@ -343,7 +343,7 @@ eslint --ext .js,.svelte src eslint "src/**/*.{js,svelte}" ``` -## :computer: Editor Integrations +## 💻 Editor Integrations ### Visual Studio Code @@ -367,9 +367,9 @@ Example **.vscode/settings.json**: -:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems. -:bulb: Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). -:star: Indicates that the rule is included in the `plugin:svelte/recommended` config. +🔧 Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems. +💡 Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +⭐️ Indicates that the rule is included in the `plugin:svelte/recommended` config. @@ -381,21 +381,21 @@ These rules relate to possible syntax or logic errors in Svelte code: |:--------|:------------|:---| | [svelte/infinite-reactive-loop](https://sveltejs.github.io/eslint-plugin-svelte/rules/infinite-reactive-loop/) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | | | [svelte/no-dom-manipulating](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dom-manipulating/) | disallow DOM manipulating | | -| [svelte/no-dupe-else-if-blocks](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks/) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: | +| [svelte/no-dupe-else-if-blocks](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks/) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | ⭐️ | | [svelte/no-dupe-on-directives](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-on-directives/) | disallow duplicate `on:` directives | | -| [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-style-properties](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-style-properties/) | disallow duplicate style properties | ⭐️ | | [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-dynamic-slot-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/) | disallow dynamic slot name | ⭐️🔧 | | [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-not-function-handler](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/) | disallow use of not function in event handler | ⭐️ | +| [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 | ⭐️ | | [svelte/no-reactive-reassign](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-reassign/) | disallow reassigning reactive values | | -| [svelte/no-shorthand-style-property-overrides](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-shorthand-style-property-overrides/) | disallow shorthand style properties that override related longhand properties | :star: | +| [svelte/no-shorthand-style-property-overrides](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-shorthand-style-property-overrides/) | disallow shorthand style properties that override related longhand properties | ⭐️ | | [svelte/no-store-async](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-store-async/) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | | -| [svelte/no-unknown-style-directive-property](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unknown-style-directive-property/) | disallow unknown `style:property` | :star: | +| [svelte/no-unknown-style-directive-property](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-unknown-style-directive-property/) | disallow unknown `style:property` | ⭐️ | | [svelte/require-store-callbacks-use-set-param](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-callbacks-use-set-param/) | store callbacks must use `set` param | | -| [svelte/require-store-reactive-access](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-reactive-access/) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: | -| [svelte/valid-compile](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-compile/) | disallow warnings when compiling. | :star: | +| [svelte/require-store-reactive-access](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-reactive-access/) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | 🔧 | +| [svelte/valid-compile](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-compile/) | disallow warnings when compiling. | ⭐️ | | [svelte/valid-prop-names-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-prop-names-in-kit-pages/) | disallow props other than data or errors in SvelteKit page components. | | ## Security Vulnerability @@ -404,7 +404,7 @@ These rules relate to security vulnerabilities in Svelte code: | Rule ID | Description | | |:--------|:------------|:---| -| [svelte/no-at-html-tags](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-html-tags/) | disallow use of `{@html}` to prevent XSS attack | :star: | +| [svelte/no-at-html-tags](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-html-tags/) | disallow use of `{@html}` to prevent XSS attack | ⭐️ | | [svelte/no-target-blank](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-target-blank/) | disallow `target="_blank"` attribute without `rel="noopener noreferrer"` | | ## Best Practices @@ -415,17 +415,17 @@ These rules relate to better ways of doing things to help you avoid problems: |:--------|:------------|:---| | [svelte/block-lang](https://sveltejs.github.io/eslint-plugin-svelte/rules/block-lang/) | disallows the use of languages other than those specified in the configuration for the lang attribute of ` + +
+ {@html data.content.html} +
+ + diff --git a/docs-svelte-kit/src/routes/[slug]/[slug]/+page.server.ts b/docs-svelte-kit/src/routes/[slug]/[slug]/+page.server.ts new file mode 100644 index 000000000..a12ac6ae8 --- /dev/null +++ b/docs-svelte-kit/src/routes/[slug]/[slug]/+page.server.ts @@ -0,0 +1,13 @@ +import { getParsedMarkdown } from '$lib/server/markdown.js'; +import { error } from '@sveltejs/kit'; +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ params }) => { + const content = await getParsedMarkdown(`${process.cwd()}/../docs/rules/${params.slug}.md`); + + if (content) { + return { content }; + } + + error(404, 'Not found'); +}; diff --git a/docs-svelte-kit/src/routes/[slug]/[slug]/+page.svelte b/docs-svelte-kit/src/routes/[slug]/[slug]/+page.svelte new file mode 100644 index 000000000..600c7a4fd --- /dev/null +++ b/docs-svelte-kit/src/routes/[slug]/[slug]/+page.svelte @@ -0,0 +1,26 @@ + + +
+ {@html data.content.html} +
+ + diff --git a/docs-svelte-kit/src/site.css b/docs-svelte-kit/src/site.css index b677d40bb..9f26f101c 100644 --- a/docs-svelte-kit/src/site.css +++ b/docs-svelte-kit/src/site.css @@ -1,49 +1,51 @@ /* @import "prismjs/themes/prism"; */ -@import "prismjs/themes/prism-tomorrow"; +@import 'prismjs/themes/prism-tomorrow'; /* theme */ :root { - --primary-color: #ffffff; - --secondary-color: #676778; - --tertiary-color: #edf0f8; - --background-without-opacity: rgba(255, 255, 255, 0.95); + --primary-color: #ffffff; + --secondary-color: #676778; + --tertiary-color: #edf0f8; + --background-without-opacity: rgba(255, 255, 255, 0.95); } /*** markdown ***/ :not(pre) > code { - padding: 0.1rem 0.4rem 0; - margin: 0 0.2rem; - background: #e5eef5; - position: relative; - border-radius: 0.3em; - white-space: nowrap; - color: #444; - -webkit-font-smoothing: initial; + padding: 0 0.4rem; + margin: 0.2rem; + background: #e5eef5; + position: relative; + border-radius: 0.3em; + white-space: nowrap; + color: #444; + -webkit-font-smoothing: initial; + display: inline-flex; + align-items: center; } blockquote { - padding: 1rem; - color: #09f; - border: 1px solid #40b3ff; - margin: 1.6rem 2.4rem 2.4rem; - padding: 0.5rem 2.4rem; - border-radius: 0.4rem; + padding: 1rem; + color: #09f; + border: 1px solid #40b3ff; + margin: 1.6rem 2.4rem 2.4rem; + padding: 0.5rem 2.4rem; + border-radius: 0.4rem; } blockquote p { - color: #09f; + color: #09f; } table { - margin: 0 0 2em; - width: 100%; - font-size: var(--h5); + margin: 0 0 2em; + width: 100%; + font-size: var(--h5); } td, th { - text-align: left; - border-bottom: 1px solid rgba(0 0 0 / 0.1); - padding: 0.4rem 0.8rem 0.4rem 0; + text-align: left; + border-bottom: 1px solid rgba(0 0 0 / 0.1); + padding: 0.4rem 0.8rem 0.4rem 0; } /* header */ @@ -52,89 +54,89 @@ h3, h4, h5, h6 { - font-weight: 400; - color: var(--heading-color); + font-weight: 400; + color: var(--heading-color); } h2 { - font-size: 1.2rem; + font-size: 1.2rem; } h3, h4, h5, h6 { - font-size: 1rem; + font-size: 1rem; } /*** custom container ***/ .custom-block .custom-block-title { - font-weight: 600; - margin-bottom: -0.4rem; + font-weight: 600; + margin-bottom: -0.4rem; } .custom-block.danger, .custom-block.tip, .custom-block.warning { - padding: 0.1rem 1.5rem; - border-left-width: 4px; - border-left-style: solid; - margin: 1rem 0; + padding: 0.1rem 1.5rem; + border-left-width: 4px; + border-left-style: solid; + margin: 1rem 0; } .custom-block.tip { - background-color: #f3f5f7; - border-color: #42b983; + background-color: #f3f5f7; + border-color: #42b983; } .custom-block.warning { - background-color: rgba(255, 229, 100, 0.3); - border-color: #e7c000; - color: #6b5900; + background-color: rgba(255, 229, 100, 0.3); + border-color: #e7c000; + color: #6b5900; } .custom-block.warning .custom-block-title { - color: #b29400; + color: #b29400; } .custom-block.warning a { - color: #2c3e50; + color: #2c3e50; } .custom-block.danger { - background-color: #ffe6e6; - border-color: #c00; - color: #4d0000; + background-color: #ffe6e6; + border-color: #c00; + color: #4d0000; } .custom-block.danger .custom-block-title { - color: #900; + color: #900; } .custom-block.danger a { - color: #2c3e50; + color: #2c3e50; } .custom-block.details { - display: block; - position: relative; - border-radius: 2px; - margin: 1.6em 0; - padding: 1.6em; - background-color: #eee; + display: block; + position: relative; + border-radius: 2px; + margin: 1.6em 0; + padding: 1.6em; + background-color: #eee; } .custom-block.details h4 { - margin-top: 0; + margin-top: 0; } .custom-block.details figure:last-child, .custom-block.details p:last-child { - margin-bottom: 0; - padding-bottom: 0; + margin-bottom: 0; + padding-bottom: 0; } .custom-block.details summary { - outline: none; - cursor: pointer; + outline: none; + cursor: pointer; } diff --git a/docs-svelte-kit/svelte.config.js b/docs-svelte-kit/svelte.config.js index f147414a7..c5d72b045 100644 --- a/docs-svelte-kit/svelte.config.js +++ b/docs-svelte-kit/svelte.config.js @@ -1,3 +1,4 @@ +import { sveltePreprocess } from 'svelte-preprocess'; import ghpagesAdapter from 'svelte-adapter-ghpages'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -16,6 +17,7 @@ const config = { preserveWhitespace: true }, extensions: ['.svelte', '.md'], + preprocess: sveltePreprocess(), kit: { paths: { base: '/eslint-plugin-svelte', @@ -26,6 +28,7 @@ const config = { pages: outDir, assets: outDir }), + files: { routes: path.join(dirname, './src/routes'), appTemplate: path.join(dirname, './src/app.html'), diff --git a/docs-svelte-kit/tsconfig.json b/docs-svelte-kit/tsconfig.json index 960929754..ce9cd857e 100644 --- a/docs-svelte-kit/tsconfig.json +++ b/docs-svelte-kit/tsconfig.json @@ -2,8 +2,6 @@ "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { "target": "es2020", - "module": "NodeNext", - "moduleResolution": "Node16", "lib": ["es2020", "dom"], "allowJs": true, "checkJs": true, diff --git a/docs/README.md b/docs/README.md index 6bfbba28b..038b60903 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,7 +42,7 @@ The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with t We are working on support for Svelte v5, but it is still an experimental feature. Please note that rules and features related to Svelte v5 may be changed or removed in minor versions without notice. -## :book: Usage +## 📖 Usage See [User Guide](./user-guide.md). diff --git a/docs/rules.md b/docs/rules.md index 7f115da5c..4ef998d08 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -4,9 +4,9 @@ sidebarDepth: 0 # Available Rules -:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems. -:bulb: Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). -:star: Indicates that the rule is included in the `plugin:svelte/recommended` config. +🔧 Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems. +💡 Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +⭐️ Indicates that the rule is included in the `plugin:svelte/recommended` config. @@ -14,125 +14,125 @@ 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-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](./infinite-reactive-loop) | Svelte runtime prevents calling the same reactive statement twice in a microtask. But between different microtask, it doesn't prevent. | | +| [svelte/no-dom-manipulating](./no-dom-manipulating) | disallow DOM manipulating | | +| [svelte/no-dupe-else-if-blocks](./no-dupe-else-if-blocks) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | ⭐️ | +| [svelte/no-dupe-on-directives](./no-dupe-on-directives) | disallow duplicate `on:` directives | | +| [svelte/no-dupe-style-properties](./no-dupe-style-properties) | disallow duplicate style properties | ⭐️ | +| [svelte/no-dupe-use-directives](./no-dupe-use-directives) | disallow duplicate `use:` directives | | +| [svelte/no-dynamic-slot-name](./no-dynamic-slot-name) | disallow dynamic slot name | ⭐️🔧 | +| [svelte/no-export-load-in-svelte-module-in-kit-pages](./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](./no-not-function-handler) | disallow use of not function in event handler | ⭐️ | +| [svelte/no-object-in-text-mustaches](./no-object-in-text-mustaches) | disallow objects in text mustache interpolation | ⭐️ | +| [svelte/no-reactive-reassign](./no-reactive-reassign) | disallow reassigning reactive values | | +| [svelte/no-shorthand-style-property-overrides](./no-shorthand-style-property-overrides) | disallow shorthand style properties that override related longhand properties | ⭐️ | +| [svelte/no-store-async](./no-store-async) | disallow using async/await inside svelte stores because it causes issues with the auto-unsubscribing features | | +| [svelte/no-unknown-style-directive-property](./no-unknown-style-directive-property) | disallow unknown `style:property` | ⭐️ | +| [svelte/require-store-callbacks-use-set-param](./require-store-callbacks-use-set-param) | store callbacks must use `set` param | | +| [svelte/require-store-reactive-access](./require-store-reactive-access) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | 🔧 | +| [svelte/valid-compile](./valid-compile) | disallow warnings when compiling. | ⭐️ | +| [svelte/valid-prop-names-in-kit-pages](./valid-prop-names-in-kit-pages) | disallow props other than data or errors in SvelteKit page components. | | ## Security Vulnerability These rules relate to security vulnerabilities in Svelte code: -| Rule ID | Description | | -| :--------------------------------------------------- | :----------------------------------------------------------------------- | :----- | -| [svelte/no-at-html-tags](./rules/no-at-html-tags.md) | disallow use of `{@html}` to prevent XSS attack | :star: | -| [svelte/no-target-blank](./rules/no-target-blank.md) | disallow `target="_blank"` attribute without `rel="noopener noreferrer"` | | +| Rule ID | Description | | +| :------------------------------------------ | :----------------------------------------------------------------------- | :-- | +| [svelte/no-at-html-tags](./no-at-html-tags) | disallow use of `{@html}` to prevent XSS attack | ⭐️ | +| [svelte/no-target-blank](./no-target-blank) | disallow `target="_blank"` attribute without `rel="noopener noreferrer"` | | ## Best Practices These rules relate to better ways of doing things to help you avoid problems: -| Rule ID | Description | | -| :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :------- | -| [svelte/block-lang](./rules/block-lang.md) | disallows the use of languages other than those specified in the configuration for the lang attribute of `