Skip to content

Commit df45b7b

Browse files
committed
wip
1 parent 38a963b commit df45b7b

File tree

3 files changed

+35
-78
lines changed

3 files changed

+35
-78
lines changed

README.md

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
# Introduction
2-
3-
`eslint-plugin-svelte` is the official [ESLint] plugin for [Svelte].
4-
It provides many unique check rules by using the template AST.
5-
You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript).
6-
7-
> [!NOTE]
8-
> This document is in development.\
9-
> Please refer to the document for the version you are using.\
10-
> For example, <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/README.md>
11-
> and <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/docs>
1+
<!--DOCS_IGNORE_START-->
122

133
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
144
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
@@ -24,52 +14,46 @@ You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/
2414
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
2515
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
2616

27-
## :name_badge: What is this plugin?
17+
<div align="center">
2818

29-
[ESLint] plugin for [Svelte].
30-
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
19+
# eslint-plugin-svelte
3120

32-
### ❗ Attention
21+
### ESLint plugin for Svelte using AST
3322

34-
#### Cannot be used with eslint-plugin-svelte3
23+
[Live Demo](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript)
24+
[Documentation](https://sveltejs.github.io/eslint-plugin-svelte/)
25+
[Discord](https://svelte.dev/chat)
3526

36-
The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3].
27+
</div>
3728

38-
[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser
39-
[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3
29+
<!--DOCS_IGNORE_END-->
4030

41-
#### Experimental support for Svelte v5
31+
# Introduction
4232

43-
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.
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.
4436

45-
<!--DOCS_IGNORE_START-->
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).
4639
47-
## Versioning policy
48-
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-->
5341

5442
## Migration Guide
5543

5644
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/).
5745

58-
## :book: Documentation
59-
60-
See [documents](https://sveltejs.github.io/eslint-plugin-svelte/).
46+
## Installation
6147

62-
## :cd: Installation
48+
> [!NOTE] > **Requirements**
49+
>
50+
> - ESLint v8.57.1, v9.0.0, and above
51+
> - Node.js v18.20.4, v20.18.0, v22.10.0, and above
6352
6453
```bash
6554
npm install --save-dev eslint eslint-plugin-svelte svelte
6655
```
6756

68-
> **Requirements**
69-
>
70-
> - ESLint v8.57.1, v9.0.0 and above
71-
> - Node.js v18.20.4, v20.18.0, v22.10.0 and above
72-
7357
<!--DOCS_IGNORE_END-->
7458

7559
## :book: Usage
@@ -453,6 +437,13 @@ These rules relate to this plugin works:
453437

454438
<!--DOCS_IGNORE_START-->
455439

440+
## Versioning policy
441+
442+
This plugin follows [Semantic Versioning](https://semver.org/).
443+
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.
444+
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.
445+
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.
446+
456447
## :beers: Contributing
457448

458449
Welcome contributing!

docs/README.md

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,12 @@ title: 'eslint-plugin-svelte'
44

55
# Introduction
66

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.
1010

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-
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
18-
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
19-
[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&colorB=green&suffix=/day&query=$.downloads&uri=https://api.npmjs.org//downloads/point/last-day/eslint-plugin-svelte&maxAge=3600)](http://www.npmtrends.com/eslint-plugin-svelte)
20-
[![NPM downloads](https://img.shields.io/npm/dw/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
21-
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
22-
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
23-
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
24-
[![Build Status](https://github.com/sveltejs/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/sveltejs/eslint-plugin-svelte/actions?query=workflow%3ACI)
25-
26-
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fsveltejs%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
27-
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
28-
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
29-
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
30-
31-
## :name_badge: What is this plugin?
32-
33-
[ESLint] plugin for [Svelte].
34-
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
35-
36-
### ❗ Attention
37-
38-
#### Cannot be used with eslint-plugin-svelte3
39-
40-
The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3].
41-
42-
[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser
43-
[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3
44-
45-
#### Experimental support for Svelte v5
46-
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.
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).
4813
4914
## :book: Usage
5015

packages/eslint-plugin-svelte/tools/update-readme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ ${newReadme
3838
)
3939
.replace(/<!--DOCS_IGNORE_START-->[\s\S]*?<!--DOCS_IGNORE_END-->/gu, '')
4040
.replace(
41-
/\(https:\/\/sveltejs.github.io\/eslint-plugin-svelte(.*?)\)/gu,
41+
/\(https:\/\/sveltejs.github.io\/eslint-plugin-svelte\/(.+)\)/gu,
4242
(_ptn, filepath: string) => {
4343
const [hash] = /(?:#.*)?$/u.exec(filepath)!;
4444
const pathWithoutHash = hash ? filepath.slice(0, -hash.length) : filepath;
4545
const normalizePathWithoutHash = pathWithoutHash.replace(/\/$/u, '');
46+
4647
const [file] = /[^/]+$/u.exec(normalizePathWithoutHash)!;
4748
const pathWithoutFile = file
4849
? normalizePathWithoutHash.slice(0, -file.length)

0 commit comments

Comments
 (0)