Skip to content

Commit 88c133e

Browse files
committed
update readme
1 parent 9818c64 commit 88c133e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
],
4242
overrides: [
4343
{
44-
files: '*.svelte',
44+
files: ['*.svelte'],
4545
processor: 'svelte3/svelte3'
4646
}
4747
],
@@ -54,7 +54,7 @@ module.exports = {
5454
};
5555
```
5656

57-
This plugin needs to be able to `require('svelte/compiler')`. If ESLint, this plugin, and Svelte are all installed locally in your project, this should not be a problem.
57+
By default, this plugin needs to be able to `require('svelte/compiler')`. If ESLint, this plugin, and Svelte are all installed locally in your project, this should not be a problem.
5858

5959
## Interactions with other plugins
6060

@@ -68,26 +68,34 @@ Passing a function as a value for a setting (which some of the settings below re
6868

6969
### `svelte3/ignore-warnings`
7070

71-
This can be a function that indicates whether to ignore a warning in the linting. The function will be passed a warning object and should return a boolean.
71+
This setting can be given a function that indicates whether to ignore a warning in the linting. The function will be passed a warning object and should return a boolean.
7272

7373
The default is to not ignore any warnings.
7474

7575
### `svelte3/compiler-options`
7676

7777
Most compiler options do not affect the validity of compiled components, but a couple of them can. If you are compiling to custom elements, or for some other reason need to control how the plugin compiles the components it's linting, you can use this setting.
7878

79-
This can be an object of compiler options.
79+
This setting can be given an object of compiler options.
8080

8181
The default is to compile with `{ generate: false }`.
8282

8383
### `svelte3/ignore-styles`
8484

8585
If you're using some sort of preprocessor on the component styles, then it's likely that when this plugin calls the Svelte compiler on your component, it will throw an exception. In a perfect world, this plugin would be able to apply the preprocessor to the component and then use source maps to translate any warnings back to the original source. In the current reality, however, you can instead simply disregard styles written in anything other than standard CSS. You won't get warnings about the styles from the linter, but your application will still use them (of course) and compiler warnings will still appear in your build logs.
8686

87-
This can be a function that accepts an object of attributes on a `<style>` tag (like that passed to a Svelte preprocessor) and returns whether to ignore the style block for the purposes of linting.
87+
This setting can be given a function that accepts an object of attributes on a `<style>` tag (like that passed to a Svelte preprocessor) and returns whether to ignore the style block for the purposes of linting.
8888

8989
The default is to not ignore any styles.
9090

91+
### `svelte3/compiler`
92+
93+
In some esoteric setups, this plugin might not be able to find the correct instance of the Svelte compiler to use.
94+
95+
This setting can be given the result of `require('.../path/to/svelte/compiler')` to indicate which instance should be used in linting the components.
96+
97+
The default is `require('svelte/compiler')` from wherever the plugin is installed to.
98+
9199
## Using the CLI
92100

93101
It's probably a good idea to make sure you can lint from the command line before proceeding with configuring your editor.

0 commit comments

Comments
 (0)