Skip to content

Commit b780f63

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

11 files changed

+47
-33
lines changed

README.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Introduction
22

3-
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].\
4-
It provides many unique check rules by using the template AST.\
3+
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].
4+
It provides many unique check rules by using the template AST.
55
You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-svelte/playground/).
66

77
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
@@ -13,9 +13,15 @@ You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-sve
1313
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1414
[![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)
1515

16+
[![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)
17+
[![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)
18+
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
19+
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
20+
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
21+
1622
## :name_badge: What is this plugin?
1723

18-
[ESLint] plugin for [Svelte].\
24+
[ESLint] plugin for [Svelte].
1925
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
2026

2127
### ❓ Why?
@@ -183,7 +189,7 @@ See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
183189

184190
You can change the behavior of this plugin with some settings.
185191

186-
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.\
192+
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.
187193
For example, set rules on the template that cannot avoid false positives.
188194
- `compileOptions` (optional) ... Specifies options for Svelte compile. Effects rules that use Svelte compile. The target rules are [svelte/valid-compile](https://ota-meshi.github.io/eslint-plugin-svelte/rules/valid-compile/) and [svelte/no-unused-svelte-ignore](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-unused-svelte-ignore/). **Note that it has no effect on ESLint's custom parser**.
189195
- `postcss` (optional) ... Specifies options related to PostCSS. You can disable the PostCSS process by specifying `false`.
@@ -246,8 +252,8 @@ Example **.vscode/settings.json**:
246252

247253
<!--RULES_SECTION_START-->
248254

249-
:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems.\
250-
:bulb: Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).\
255+
:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems.
256+
:bulb: Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
251257
:star: Indicates that the rule is included in the `plugin:svelte/recommended` config.
252258

253259
<!--RULES_TABLE_START-->
@@ -352,14 +358,14 @@ Please use GitHub's Issues/PRs.
352358

353359
### Test the Rule
354360

355-
Rule testing almost always uses fixtures.\
356-
For example, for an `indent` rule, the `.ts` file that runs the test is `tests/src/rules/indent.ts` and the fixture is in `tests/fixtures/rules/indent`.\
361+
Rule testing almost always uses fixtures.
362+
For example, for an `indent` rule, the `.ts` file that runs the test is `tests/src/rules/indent.ts` and the fixture is in `tests/fixtures/rules/indent`.
357363
The fixture directory has an `invalid` directory and a `valid` directory.
358364

359365
- The `invalid` directory contains test cases where the rule reports problems.
360366
- The `valid` directory contains test cases where the rule does not report a problem.
361367

362-
The fixture input file should be named `*-input.svelte`. It is automatically collected and tested.\
368+
The fixture input file should be named `*-input.svelte`. It is automatically collected and tested.
363369
If your test requires configuration, you need to add a json file with the configuration.
364370

365371
- If you want to apply a configuration to `my-test-input.svelte`, add `my-test-config.json`.
@@ -377,7 +383,7 @@ yarn test -g indent
377383

378384
Take <https://stackoverflow.com/questions/10832031/how-to-run-a-single-test-with-mocha> as reference for details.
379385

380-
If you want to test only `my-test-input.svelte`, add `my-test-config.json` and save `{"only": true}`.\
386+
If you want to test only `my-test-input.svelte`, add `my-test-config.json` and save `{"only": true}`.
381387
(Note that `{"only": true}` must be removed before making a pull request.)
382388

383389
### Working With Rules

docs/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ 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+
## :name_badge: What is this plugin?
2121

22-
[ESLint] plugin for [Svelte].\
22+
[ESLint] plugin for [Svelte].
2323
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
2424

2525
### ❓ Why?
@@ -39,7 +39,7 @@ The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with t
3939

4040
See [User Guide](./user-guide.md).
4141

42-
## :white\_check\_mark: Rules
42+
## :white_check_mark: Rules
4343

4444
See [Available Rules](./rules.md).
4545

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

0 commit comments

Comments
 (0)