|
2 | 2 |
|
3 | 3 | `@ota-meshi/eslint-plugin-svelte` is ESLint plugin for Svelte.
|
4 | 4 | It provides many unique check rules by using the template AST.
|
5 |
| -You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-svelte/playground). |
| 5 | +You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-svelte/playground/). |
6 | 6 |
|
7 | 7 | ::: **_WORKS IN PROGRESS_** :::
|
8 | 8 |
|
@@ -85,7 +85,7 @@ This plugin provides configs:
|
85 | 85 | - `plugin:@ota-meshi/svelte/base` ... Configuration to enable correct Svelte parsing.
|
86 | 86 | - `plugin:@ota-meshi/svelte/recommended` ... Above, plus rules to prevent errors or unintended behavior.
|
87 | 87 |
|
88 |
| -See [the rule list](https://ota-meshi.github.io/eslint-plugin-svelte/rules) to get the `rules` that this plugin provides. |
| 88 | +See [the rule list](https://ota-meshi.github.io/eslint-plugin-svelte/rules/) to get the `rules` that this plugin provides. |
89 | 89 |
|
90 | 90 | ::: warning ❗ Attention
|
91 | 91 |
|
@@ -245,64 +245,64 @@ The rules with the following star :star: are included in the configs.
|
245 | 245 |
|
246 | 246 | These rules relate to possible syntax or logic errors in Svelte code:
|
247 | 247 |
|
248 |
| -| Rule ID | Description | | |
249 |
| -|:--------|:------------|:---| |
250 |
| -| [@ota-meshi/svelte/no-dupe-else-if-blocks](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: | |
251 |
| -| [@ota-meshi/svelte/no-dynamic-slot-name](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name) | disallow dynamic slot name | :star::wrench: | |
252 |
| -| [@ota-meshi/svelte/no-not-function-handler](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-not-function-handler) | disallow use of not function in event handler | :star: | |
253 |
| -| [@ota-meshi/svelte/no-object-in-text-mustaches](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches) | disallow objects in text mustache interpolation | :star: | |
254 |
| -| [@ota-meshi/svelte/valid-compile](https://ota-meshi.github.io/eslint-plugin-svelte/rules/valid-compile) | disallow warnings when compiling. | :star: | |
| 248 | +| Rule ID | Description | | |
| 249 | +| :---------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------- | :------------- | |
| 250 | +| [@ota-meshi/svelte/no-dupe-else-if-blocks](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks) | disallow duplicate conditions in `{#if}` / `{:else if}` chains | :star: | |
| 251 | +| [@ota-meshi/svelte/no-dynamic-slot-name](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name) | disallow dynamic slot name | :star::wrench: | |
| 252 | +| [@ota-meshi/svelte/no-not-function-handler](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-not-function-handler) | disallow use of not function in event handler | :star: | |
| 253 | +| [@ota-meshi/svelte/no-object-in-text-mustaches](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches) | disallow objects in text mustache interpolation | :star: | |
| 254 | +| [@ota-meshi/svelte/valid-compile](https://ota-meshi.github.io/eslint-plugin-svelte/rules/valid-compile) | disallow warnings when compiling. | :star: | |
255 | 255 |
|
256 | 256 | ## Security Vulnerability
|
257 | 257 |
|
258 | 258 | These rules relate to security vulnerabilities in Svelte code:
|
259 | 259 |
|
260 |
| -| Rule ID | Description | | |
261 |
| -|:--------|:------------|:---| |
262 |
| -| [@ota-meshi/svelte/no-at-html-tags](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-at-html-tags) | disallow use of `{@html}` to prevent XSS attack | :star: | |
263 |
| -| [@ota-meshi/svelte/no-target-blank](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-target-blank) | disallow `target="_blank"` attribute without `rel="noopener noreferrer"` | | |
| 260 | +| Rule ID | Description | | |
| 261 | +| :---------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------- | :----- | |
| 262 | +| [@ota-meshi/svelte/no-at-html-tags](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-at-html-tags) | disallow use of `{@html}` to prevent XSS attack | :star: | |
| 263 | +| [@ota-meshi/svelte/no-target-blank](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-target-blank) | disallow `target="_blank"` attribute without `rel="noopener noreferrer"` | | |
264 | 264 |
|
265 | 265 | ## Best Practices
|
266 | 266 |
|
267 | 267 | These rules relate to better ways of doing things to help you avoid problems:
|
268 | 268 |
|
269 |
| -| Rule ID | Description | | |
270 |
| -|:--------|:------------|:---| |
271 |
| -| [@ota-meshi/svelte/button-has-type](https://ota-meshi.github.io/eslint-plugin-svelte/rules/button-has-type) | disallow usage of button without an explicit type attribute | | |
272 |
| -| [@ota-meshi/svelte/no-at-debug-tags](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-at-debug-tags) | disallow the use of `{@debug}` | :star: | |
273 |
| -| [@ota-meshi/svelte/no-useless-mustaches](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-useless-mustaches) | disallow unnecessary mustache interpolations | :wrench: | |
| 269 | +| Rule ID | Description | | |
| 270 | +| :-------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- | :------- | |
| 271 | +| [@ota-meshi/svelte/button-has-type](https://ota-meshi.github.io/eslint-plugin-svelte/rules/button-has-type) | disallow usage of button without an explicit type attribute | | |
| 272 | +| [@ota-meshi/svelte/no-at-debug-tags](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-at-debug-tags) | disallow the use of `{@debug}` | :star: | |
| 273 | +| [@ota-meshi/svelte/no-useless-mustaches](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-useless-mustaches) | disallow unnecessary mustache interpolations | :wrench: | |
274 | 274 |
|
275 | 275 | ## Stylistic Issues
|
276 | 276 |
|
277 | 277 | These rules relate to style guidelines, and are therefore quite subjective:
|
278 | 278 |
|
279 |
| -| Rule ID | Description | | |
280 |
| -|:--------|:------------|:---| |
281 |
| -| [@ota-meshi/svelte/first-attribute-linebreak](https://ota-meshi.github.io/eslint-plugin-svelte/rules/first-attribute-linebreak) | enforce the location of first attribute | :wrench: | |
282 |
| -| [@ota-meshi/svelte/html-quotes](https://ota-meshi.github.io/eslint-plugin-svelte/rules/html-quotes) | enforce quotes style of HTML attributes | :wrench: | |
283 |
| -| [@ota-meshi/svelte/indent](https://ota-meshi.github.io/eslint-plugin-svelte/rules/indent) | enforce consistent indentation | :wrench: | |
284 |
| -| [@ota-meshi/svelte/max-attributes-per-line](https://ota-meshi.github.io/eslint-plugin-svelte/rules/max-attributes-per-line) | enforce the maximum number of attributes per line | :wrench: | |
285 |
| -| [@ota-meshi/svelte/mustache-spacing](https://ota-meshi.github.io/eslint-plugin-svelte/rules/mustache-spacing) | enforce unified spacing in mustache | :wrench: | |
286 |
| -| [@ota-meshi/svelte/prefer-class-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/prefer-class-directive) | require class directives instead of ternary expressions | :wrench: | |
287 |
| -| [@ota-meshi/svelte/shorthand-attribute](https://ota-meshi.github.io/eslint-plugin-svelte/rules/shorthand-attribute) | enforce use of shorthand syntax in attribute | :wrench: | |
288 |
| -| [@ota-meshi/svelte/spaced-html-comment](https://ota-meshi.github.io/eslint-plugin-svelte/rules/spaced-html-comment) | enforce consistent spacing after the `<!--` and before the `-->` in a HTML comment | :wrench: | |
| 279 | +| Rule ID | Description | | |
| 280 | +| :------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | :------- | |
| 281 | +| [@ota-meshi/svelte/first-attribute-linebreak](https://ota-meshi.github.io/eslint-plugin-svelte/rules/first-attribute-linebreak) | enforce the location of first attribute | :wrench: | |
| 282 | +| [@ota-meshi/svelte/html-quotes](https://ota-meshi.github.io/eslint-plugin-svelte/rules/html-quotes) | enforce quotes style of HTML attributes | :wrench: | |
| 283 | +| [@ota-meshi/svelte/indent](https://ota-meshi.github.io/eslint-plugin-svelte/rules/indent) | enforce consistent indentation | :wrench: | |
| 284 | +| [@ota-meshi/svelte/max-attributes-per-line](https://ota-meshi.github.io/eslint-plugin-svelte/rules/max-attributes-per-line) | enforce the maximum number of attributes per line | :wrench: | |
| 285 | +| [@ota-meshi/svelte/mustache-spacing](https://ota-meshi.github.io/eslint-plugin-svelte/rules/mustache-spacing) | enforce unified spacing in mustache | :wrench: | |
| 286 | +| [@ota-meshi/svelte/prefer-class-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/prefer-class-directive) | require class directives instead of ternary expressions | :wrench: | |
| 287 | +| [@ota-meshi/svelte/shorthand-attribute](https://ota-meshi.github.io/eslint-plugin-svelte/rules/shorthand-attribute) | enforce use of shorthand syntax in attribute | :wrench: | |
| 288 | +| [@ota-meshi/svelte/spaced-html-comment](https://ota-meshi.github.io/eslint-plugin-svelte/rules/spaced-html-comment) | enforce consistent spacing after the `<!--` and before the `-->` in a HTML comment | :wrench: | |
289 | 289 |
|
290 | 290 | ## Extension Rules
|
291 | 291 |
|
292 | 292 | These rules extend the rules provided by ESLint itself to work well in Svelte:
|
293 | 293 |
|
294 |
| -| Rule ID | Description | | |
295 |
| -|:--------|:------------|:---| |
| 294 | +| Rule ID | Description | | |
| 295 | +| :---------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------ | :----- | |
296 | 296 | | [@ota-meshi/svelte/no-inner-declarations](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-inner-declarations) | disallow variable or `function` declarations in nested blocks | :star: |
|
297 | 297 |
|
298 | 298 | ## System
|
299 | 299 |
|
300 | 300 | These rules relate to this plugin works:
|
301 | 301 |
|
302 |
| -| Rule ID | Description | | |
303 |
| -|:--------|:------------|:---| |
| 302 | +| Rule ID | Description | | |
| 303 | +| :-------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | :----- | |
304 | 304 | | [@ota-meshi/svelte/comment-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/comment-directive) | support comment-directives in HTML template | :star: |
|
305 |
| -| [@ota-meshi/svelte/system](https://ota-meshi.github.io/eslint-plugin-svelte/rules/system) | system rule for working this plugin | :star: | |
| 305 | +| [@ota-meshi/svelte/system](https://ota-meshi.github.io/eslint-plugin-svelte/rules/system) | system rule for working this plugin | :star: | |
306 | 306 |
|
307 | 307 | <!--RULES_TABLE_END-->
|
308 | 308 | <!--RULES_SECTION_END-->
|
|
0 commit comments