You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
20
26
21
27
### ❓ Why?
@@ -183,7 +189,7 @@ See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
183
189
184
190
You can change the behavior of this plugin with some settings.
185
191
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.
187
193
For example, set rules on the template that cannot avoid false positives.
188
194
-`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**.
189
195
-`postcss` (optional) ... Specifies options related to PostCSS. You can disable the PostCSS process by specifying `false`.
@@ -246,8 +252,8 @@ Example **.vscode/settings.json**:
246
252
247
253
<!--RULES_SECTION_START-->
248
254
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).
251
257
:star: Indicates that the rule is included in the `plugin:svelte/recommended` config.
252
258
253
259
<!--RULES_TABLE_START-->
@@ -352,14 +358,14 @@ Please use GitHub's Issues/PRs.
352
358
353
359
### Test the Rule
354
360
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`.
357
363
The fixture directory has an `invalid` directory and a `valid` directory.
358
364
359
365
- The `invalid` directory contains test cases where the rule reports problems.
360
366
- The `valid` directory contains test cases where the rule does not report a problem.
361
367
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.
363
369
If your test requires configuration, you need to add a json file with the configuration.
364
370
365
371
- 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
377
383
378
384
Take <https://stackoverflow.com/questions/10832031/how-to-run-a-single-test-with-mocha> as reference for details.
379
385
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}`.
381
387
(Note that `{"only": true}` must be removed before making a pull request.)
Copy file name to clipboardExpand all lines: docs/rules/no-inner-declarations.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ since: "v0.0.8"
16
16
17
17
This rule requires that function declarations and, optionally, variable declarations be in the root of a program or the body of a function.
18
18
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`.
Copy file name to clipboardExpand all lines: docs/rules/no-not-function-handler.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
14
14
15
15
## :book: Rule Details
16
16
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.
18
18
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.
Copy file name to clipboardExpand all lines: docs/rules/no-object-in-text-mustaches.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
14
14
15
15
## :book: Rule Details
16
16
17
-
This rule disallows the use of objects in text mustache interpolation.\
17
+
This rule disallows the use of objects in text mustache interpolation.
18
18
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.
Copy file name to clipboardExpand all lines: docs/user-guide.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,7 @@ See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
140
140
141
141
You can change the behavior of this plugin with some settings.
142
142
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.
144
144
For example, set rules on the template that cannot avoid false positives.
145
145
-`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**.
146
146
-`postcss` (optional) ... Specifies options related to PostCSS. You can disable the PostCSS process by specifying `false`.
0 commit comments