Skip to content

Commit 759b9b5

Browse files
committed
wip
1 parent 38a963b commit 759b9b5

File tree

3 files changed

+30
-44
lines changed

3 files changed

+30
-44
lines changed

README.md

+13-22
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
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>
12-
131
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
142
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
153
[![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)
@@ -24,23 +12,26 @@ You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/
2412
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
2513
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
2614

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

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

32-
### ❗ Attention
19+
### ESLint plugin for Svelte using AST
3320

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

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

38-
[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser
39-
[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3
27+
# Introduction
4028

41-
#### Experimental support for Svelte v5
29+
`eslint-plugin-svelte` is the official [ESLint](https://eslint.org/) plugin for [Svelte](https://svelte.dev/).
30+
It offers a variety of unique linting rules by leveraging the AST generated by [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser).
31+
It provides a variety of unique linting rules by utilizing the template AST.
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+
> [!WARNING]
34+
> 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).
4435
4536
<!--DOCS_IGNORE_START-->
4637

docs/README.md

+13-22
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
title: 'eslint-plugin-svelte'
33
---
44

5-
# Introduction
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).
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-
175
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
186
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
197
[![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)
@@ -28,23 +16,26 @@ You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/
2816
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
2917
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
3018

31-
## :name_badge: What is this plugin?
19+
<div align="center">
3220

33-
[ESLint] plugin for [Svelte].
34-
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
21+
# Introduction
3522

36-
### ❗ Attention
23+
### ESLint plugin for Svelte using AST
3724

38-
#### Cannot be used with eslint-plugin-svelte3
25+
[Live Demo](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript)
26+
[Documentation](../README.md)
27+
[Discord](https://svelte.dev/chat)
3928

40-
The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3].
29+
</div>
4130

42-
[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser
43-
[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3
31+
# Introduction
4432

45-
#### Experimental support for Svelte v5
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.
4636

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.
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).
4839
4940
## :book: Usage
5041

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

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ ${newReadme
4343
const [hash] = /(?:#.*)?$/u.exec(filepath)!;
4444
const pathWithoutHash = hash ? filepath.slice(0, -hash.length) : filepath;
4545
const normalizePathWithoutHash = pathWithoutHash.replace(/\/$/u, '');
46+
if (normalizePathWithoutHash === '') {
47+
return '(../README.md)';
48+
}
49+
4650
const [file] = /[^/]+$/u.exec(normalizePathWithoutHash)!;
4751
const pathWithoutFile = file
4852
? normalizePathWithoutHash.slice(0, -file.length)

0 commit comments

Comments
 (0)