Skip to content

Commit c5d2880

Browse files
committed
docs: add more badges, remove unexpected escaped line breaks
1 parent 22e380a commit c5d2880

13 files changed

+106
-84
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = {
1515
"plugin:@ota-meshi/+eslint-plugin",
1616
"plugin:@ota-meshi/+package-json",
1717
"plugin:@ota-meshi/+json",
18-
"plugin:@ota-meshi/+md",
1918
"plugin:@ota-meshi/+yaml",
19+
"plugin:@ota-meshi/+md",
2020
"plugin:@ota-meshi/+prettier",
2121
],
2222
rules: {

README.md

+64-59
Large diffs are not rendered by default.

docs/README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@ title: "eslint-plugin-svelte"
44

55
# Introduction
66

7-
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].\
8-
It provides many unique check rules by using the template AST.\
7+
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].
8+
It provides many unique check rules by using the template AST.
99
You can check on the [Online DEMO](./playground.md).
1010

1111
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
1212
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
13-
[![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)
13+
[![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)
1414
[![NPM downloads](https://img.shields.io/npm/dw/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1515
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1616
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1717
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1818
[![Build Status](https://github.com/ota-meshi/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-svelte/actions?query=workflow%3ACI)
1919

20-
## :name\_badge: What is this plugin?
20+
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ota-meshi/eslint-plugin-svelte.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ota-meshi/eslint-plugin-svelte/context:javascript)
21+
[![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%2Fota-meshi%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
22+
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
23+
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
24+
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
2125

22-
[ESLint] plugin for [Svelte].\
26+
## :name_badge: What is this plugin?
27+
28+
[ESLint] plugin for [Svelte].
2329
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
2430

2531
### ❓ Why?
@@ -39,9 +45,11 @@ The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with t
3945

4046
See [User Guide](./user-guide.md).
4147

42-
## :white\_check\_mark: Rules
48+
## :white_check_mark: Rules
4349

50+
<!-- prettier-ignore-start -->
4451
See [Available Rules](./rules.md).
52+
<!-- prettier-ignore-end -->
4553

4654
## :lock: License
4755

docs/migration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ If you want the previous behavior, replace it with [eslint-plugin-svelte3].
1010

1111
## From `@ota-meshi/eslint-plugin-svelte`
1212

13-
`@ota-meshi/eslint-plugin-svelte` has been renamed to `eslint-plugin-svelte`.\
13+
`@ota-meshi/eslint-plugin-svelte` has been renamed to `eslint-plugin-svelte`.
1414
Therefore, you need to replace the package name, and the presets, rules, and settings specified in the configuration.
1515

16-
- `package.json`\
16+
- `package.json`
1717
Replace the package name.
1818

1919
```diff
2020
- "@ota-meshi/eslint-plugin-svelte": "^0.X.X"
2121
+ "eslint-plugin-svelte": "^X.X.X"
2222
```
2323

24-
- `.eslintrc.*`\
25-
Replace `@ota-meshi/svelte` with `svelte` as a string.\
24+
- `.eslintrc.*`
25+
Replace `@ota-meshi/svelte` with `svelte` as a string.
2626
Examples:
2727

2828
- Presets

docs/rules/no-extra-reactive-curlies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Nothing.
4242

4343
## :heart: Compatibility
4444

45-
This rule was taken from [@tivac/eslint-plugin-svelte].\
45+
This rule was taken from [@tivac/eslint-plugin-svelte].
4646
This rule is compatible with `@tivac/svelte/reactive-curlies` rule.
4747

4848
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/no-inner-declarations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ since: "v0.0.8"
1616

1717
This rule requires that function declarations and, optionally, variable declarations be in the root of a program or the body of a function.
1818

19-
This rule extends the base ESLint's [no-inner-declarations] rule. The AST generated by [svelte-eslint-parser] will false positives in [no-inner-declarations] rule because the root node of the script is not the `Program`.\
19+
This rule extends the base ESLint's [no-inner-declarations] rule. The AST generated by [svelte-eslint-parser] will false positives in [no-inner-declarations] rule because the root node of the script is not the `Program`.
2020
This rule supports [svelte-eslint-parser]'s AST.
2121

2222
[svelte-eslint-parser]: https://github.com/ota-meshi/svelte-eslint-parser

docs/rules/no-not-function-handler.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
1414

1515
## :book: Rule Details
1616

17-
This rule reports where you used not function value in event handlers.\
17+
This rule reports where you used not function value in event handlers.
1818
If you use a non-function value for the event handler, it event handler will not be called. It's almost always a mistake. You may have written a lot of unnecessary curly braces.
1919

2020
<ESLintCodeBlock>

docs/rules/no-object-in-text-mustaches.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
1414

1515
## :book: Rule Details
1616

17-
This rule disallows the use of objects in text mustache interpolation.\
17+
This rule disallows the use of objects in text mustache interpolation.
1818
When you use an object for text interpolation, it is drawn as `[object Object]`. It's almost always a mistake. You may have written a lot of unnecessary curly braces.
1919

2020
<ESLintCodeBlock>

docs/rules/no-reactive-functions.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ This rule reports whenever a function is defined in a reactive statement. This i
2525
/* eslint svelte/no-reactive-functions: "error" */
2626
2727
/* ✓ GOOD */
28-
const arrowFn = () => { /* ... */ }
29-
const func = function() { /* ... */ }
30-
28+
const arrowFn = () => {
29+
/* ... */
30+
}
31+
const func = function () {
32+
/* ... */
33+
}
34+
3135
/* ✗ BAD */
32-
$: arrowFn = () => { /* ... */ }
33-
$: func = function() { /* ... */ }
36+
$: arrowFn = () => {
37+
/* ... */
38+
}
39+
$: func = function () {
40+
/* ... */
41+
}
3442
</script>
3543
```
3644

@@ -42,7 +50,7 @@ Nothing
4250

4351
## :heart: Compatibility
4452

45-
This rule was taken from [@tivac/eslint-plugin-svelte].\
53+
This rule was taken from [@tivac/eslint-plugin-svelte].
4654
This rule is compatible with `@tivac/svelte/reactive-functions` rule.
4755

4856
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/no-reactive-literals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Nothing.
3939

4040
## :heart: Compatibility
4141

42-
This rule was taken from [@tivac/eslint-plugin-svelte].\
42+
This rule was taken from [@tivac/eslint-plugin-svelte].
4343
This rule is compatible with `@tivac/svelte/reactive-literals` rule.
4444

4545
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/require-stores-init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Nothing.
4242

4343
## :heart: Compatibility
4444

45-
This rule was taken from [@tivac/eslint-plugin-svelte].\
45+
This rule was taken from [@tivac/eslint-plugin-svelte].
4646
This rule is compatible with `@tivac/svelte/stores-initial-value` rule.
4747

4848
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/user-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
140140

141141
You can change the behavior of this plugin with some settings.
142142

143-
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.\
143+
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.
144144
For example, set rules on the template that cannot avoid false positives.
145145
- `compileOptions` (optional) ... Specifies options for Svelte compile. Effects rules that use Svelte compile. The target rules are [svelte/valid-compile](./rules/valid-compile.md) and [svelte/no-unused-svelte-ignore](./rules/no-unused-svelte-ignore.md). **Note that it has no effect on ESLint's custom parser**.
146146
- `postcss` (optional) ... Specifies options related to PostCSS. You can disable the PostCSS process by specifying `false`.

tools/update-readme.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ fs.writeFileSync(
8181
)
8282
.replace(
8383
/\(https:\/\/ota-meshi.github.io\/eslint-plugin-svelte(.*?)\)/gu,
84-
(_s, c: string) => `(.${c.endsWith("/") ? c.slice(0, -1) : c}.md)`,
84+
(_s: string, c: string) =>
85+
`(.${c.endsWith("/") ? c.slice(0, -1) : c}.md)`,
8586
),
8687
"utf8",
8788
)

0 commit comments

Comments
 (0)