You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
31
+
# Introduction
44
32
45
-
<!--DOCS_IGNORE_START-->
33
+
`eslint-plugin-svelte` is the official [ESLint](https://eslint.org/) plugin for [Svelte](https://svelte.dev/).
34
+
It offers a variety of unique linting rules by leveraging the AST generated by [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser).
35
+
It provides a variety of unique linting rules by utilizing the template AST.
46
36
47
-
## Versioning policy
37
+
> [!WARNING]
38
+
> The [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser) and `eslint-plugin-svelte` cannot be used alongside [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3).
48
39
49
-
This plugin follows [Semantic Versioning](https://semver.org/).
50
-
However, unlike [ESLint’s Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy), this plugin adds new rules to its configs even in minor releases. For example, if you are using the recommended config, a minor update may add new rules, which could cause new lint errors in your project.
51
-
While [ESLint’s Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy) only adds new rules to configs in major releases, most users (myself included) don’t regularly monitor new rules. This makes it challenging to manually add them to projects whenever they are introduced.
52
-
By adding new rules to configs in minor releases, this plugin ensures users can adopt them more easily. If any new rules cause issues, you can simply disable them. I believe this approach helps maintain and improve code quality with minimal effort.
40
+
<!--DOCS_IGNORE_START-->
53
41
54
42
## Migration Guide
55
43
56
44
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/).
57
45
58
-
## :book: Documentation
59
-
60
-
See [documents](https://sveltejs.github.io/eslint-plugin-svelte/).
46
+
## Installation
61
47
62
-
## :cd: Installation
48
+
> [!NOTE]
49
+
>
50
+
> **Requirements**
51
+
>
52
+
> - ESLint v8.57.1, v9.0.0, and above
53
+
> - Node.js v18.20.4, v20.18.0, v22.10.0, and above
> - Node.js v18.20.4, v20.18.0, v22.10.0 and above
72
-
73
59
<!--DOCS_IGNORE_END-->
74
60
75
61
## :book: Usage
@@ -283,13 +269,13 @@ export default [
283
269
];
284
270
```
285
271
286
-
## :computer:Editor Integrations
272
+
## Editor Integrations
287
273
288
274
### Visual Studio Code
289
275
290
-
Use the [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension that Microsoft provides officially.
276
+
Use the [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension provided officially by Microsoft.
291
277
292
-
You have to configure the `eslint.validate` option of the extension to check`.svelte` files, because the extension targets only `*.js`or`*.jsx` files by default.
278
+
You need to configure the `eslint.validate` option in the extension settings to include`.svelte` files, as the extension only targets `*.js`and`*.jsx` files by default.
293
279
294
280
Example **.vscode/settings.json**:
295
281
@@ -302,6 +288,17 @@ Example **.vscode/settings.json**:
302
288
<!--USAGE_GUIDE_END-->
303
289
<!--USAGE_SECTION_END-->
304
290
291
+
<!--DOCS_IGNORE_START-->
292
+
293
+
## Versioning policy
294
+
295
+
This plugin follows [Semantic Versioning](https://semver.org/).
296
+
However, unlike [ESLint’s Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy), this plugin adds new rules to its configs even in minor releases. For example, if you are using the recommended config, a minor update may add new rules, which could cause new lint errors in your project.
297
+
While [ESLint’s Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy) only adds new rules to configs in major releases, most users (myself included) don’t regularly monitor new rules. This makes it challenging to manually add them to projects whenever they are introduced.
298
+
By adding new rules to configs in minor releases, this plugin ensures users can adopt them more easily. If any new rules cause issues, you can simply disable them. I believe this approach helps maintain and improve code quality with minimal effort.
299
+
300
+
<!--DOCS_IGNORE_END-->
301
+
305
302
## :white_check_mark: Rules
306
303
307
304
<!-- prettier-ignore-start -->
@@ -453,21 +450,17 @@ These rules relate to this plugin works:
453
450
454
451
<!--DOCS_IGNORE_START-->
455
452
456
-
## :beers: Contributing
457
-
458
-
Welcome contributing!
459
-
460
-
Please use GitHub's Issues/PRs.
453
+
## Contributing
461
454
462
-
See also [CONTRIBUTING.md](./CONTRIBUTING.md)
455
+
Contributions are welcome! Feel free to use GitHub Issues or submit a Pull Request (PR). For more details, see [CONTRIBUTING.md](./CONTRIBUTING.md).
463
456
464
457
### Working With Rules
465
458
466
-
This plugin uses [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser)for the parser. Check [here](https://sveltejs.github.io/svelte-eslint-parser/) to find out about AST.
459
+
This plugin uses [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser)as its parser. Check the [AST documentation](https://sveltejs.github.io/svelte-eslint-parser/) to learn more about the AST structure.
467
460
468
461
<!--DOCS_IGNORE_END-->
469
462
470
-
## :lock:License
463
+
## License
471
464
472
465
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
Copy file name to clipboardExpand all lines: docs/README.md
+6-41Lines changed: 6 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,47 +4,12 @@ title: 'eslint-plugin-svelte'
4
4
5
5
# Introduction
6
6
7
-
`eslint-plugin-svelte` is the official [ESLint] plugin for [Svelte].
8
-
It provides many unique check rules by using the template AST.
9
-
You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript).
7
+
`eslint-plugin-svelte` is the official [ESLint](https://eslint.org/) plugin for [Svelte](https://svelte.dev/).
8
+
It offers a variety of unique linting rules by leveraging the AST generated by [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser).
9
+
It provides a variety of unique linting rules by utilizing the template AST.
10
10
11
-
> [!NOTE]
12
-
> This document is in development.\
13
-
> Please refer to the document for the version you are using.\
14
-
> For example, <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/README.md>
15
-
> and <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/docs>
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.
11
+
> [!WARNING]
12
+
> The [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser) and `eslint-plugin-svelte` cannot be used alongside [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3).
48
13
49
14
## :book: Usage
50
15
@@ -56,7 +21,7 @@ See [User Guide](./user-guide.md).
56
21
See [Available Rules](./rules.md).
57
22
<!-- prettier-ignore-end -->
58
23
59
-
## :lock:License
24
+
## License
60
25
61
26
See the [LICENSE](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/LICENSE) file for license rights and limitations (MIT).
Copy file name to clipboardExpand all lines: docs/user-guide.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,13 +228,13 @@ export default [
228
228
];
229
229
```
230
230
231
-
## :computer:Editor Integrations
231
+
## Editor Integrations
232
232
233
233
### Visual Studio Code
234
234
235
-
Use the [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension that Microsoft provides officially.
235
+
Use the [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension provided officially by Microsoft.
236
236
237
-
You have to configure the `eslint.validate` option of the extension to check`.svelte` files, because the extension targets only `*.js`or`*.jsx` files by default.
237
+
You need to configure the `eslint.validate` option in the extension settings to include`.svelte` files, as the extension only targets `*.js`and`*.jsx` files by default.
0 commit comments