|
2 | 2 | title: 'eslint-plugin-svelte'
|
3 | 3 | ---
|
4 | 4 |
|
5 |
| -# Introduction |
| 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 leverages the AST generated by [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser) to provide custom linting for Svelte. |
| 9 | +Note that `eslint-plugin-svelte` and `svelte-eslint-parser` cannot be used alongside [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3). |
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> |
16 |
| -
|
17 |
| -[](https://www.npmjs.com/package/eslint-plugin-svelte) |
18 |
| -[](https://www.npmjs.com/package/eslint-plugin-svelte) |
19 |
| -[](http://www.npmtrends.com/eslint-plugin-svelte) |
20 |
| -[](http://www.npmtrends.com/eslint-plugin-svelte) |
21 |
| -[](http://www.npmtrends.com/eslint-plugin-svelte) |
22 |
| -[](http://www.npmtrends.com/eslint-plugin-svelte) |
23 |
| -[](http://www.npmtrends.com/eslint-plugin-svelte) |
24 |
| -[](https://github.com/sveltejs/eslint-plugin-svelte/actions?query=workflow%3ACI) |
25 |
| - |
26 |
| -[](https://github.com/plantain-00/type-coverage) |
27 |
| -[](https://conventionalcommits.org) |
28 |
| -[](https://github.com/prettier/prettier) |
29 |
| -[](https://github.com/atlassian/changesets) |
30 |
| - |
31 |
| -## :name_badge: What is this plugin? |
| 11 | +## Installation |
32 | 12 |
|
33 |
| -[ESLint] plugin for [Svelte]. |
34 |
| -It provides many unique check rules using the AST generated by [svelte-eslint-parser]. |
| 13 | +```bash |
| 14 | +npm install --save-dev svelte eslint eslint-plugin-svelte globals |
| 15 | +``` |
35 | 16 |
|
36 |
| -### ❗ Attention |
| 17 | +> [!NOTE] |
| 18 | +> |
| 19 | +> **Requirements:** |
| 20 | +> |
| 21 | +> - ESLint v8.57.1, v9.0.0, and above |
| 22 | +> - Node.js v18.20.4, v20.18.0, v22.10.0, and above |
37 | 23 |
|
38 |
| -#### Cannot be used with eslint-plugin-svelte3 |
| 24 | +## Configuration |
39 | 25 |
|
40 |
| -The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3]. |
| 26 | +See [User Guide](./user-guide.md). |
41 | 27 |
|
42 |
| -[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser |
43 |
| -[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3 |
| 28 | +## Migration Guide |
44 | 29 |
|
45 |
| -#### Experimental support for Svelte v5 |
| 30 | +If you’re migrating from `eslint-plugin-svelte` v1 or [`@ota-meshi/eslint-plugin-svelte`](https://www.npmjs.com/package/@ota-meshi/eslint-plugin-svelte), see the [migration guide](./migration.md). |
46 | 31 |
|
47 |
| -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. |
| 32 | +## Versioning Policy |
48 | 33 |
|
49 |
| -## :book: Usage |
| 34 | +This project follows [Semantic Versioning](https://semver.org/). Unlike [ESLint’s versioning policy](https://github.com/eslint/eslint#semantic-versioning-policy), new rules may be added in minor releases. If these new rules cause unwanted warnings, you can disable them. |
50 | 35 |
|
51 |
| -See [User Guide](./user-guide.md). |
| 36 | +<!--DOCS_IGNORE_END--> |
52 | 37 |
|
53 |
| -## :white_check_mark: Rules |
| 38 | +## Rules |
54 | 39 |
|
55 | 40 | <!-- prettier-ignore-start -->
|
56 | 41 | See [Available Rules](./rules.md).
|
57 | 42 | <!-- prettier-ignore-end -->
|
58 | 43 |
|
59 |
| -## :lock: License |
60 |
| - |
61 |
| -See the [LICENSE](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/LICENSE) file for license rights and limitations (MIT). |
| 44 | +## License |
62 | 45 |
|
63 |
| -[svelte]: https://svelte.dev/ |
64 |
| -[eslint]: https://eslint.org/ |
| 46 | +See [LICENSE](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/LICENSE) (MIT). |
0 commit comments