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
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ module.exports = {
41
41
],
42
42
overrides: [
43
43
{
44
-
files:'*.svelte',
44
+
files:['*.svelte'],
45
45
processor:'svelte3/svelte3'
46
46
}
47
47
],
@@ -54,7 +54,7 @@ module.exports = {
54
54
};
55
55
```
56
56
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.
58
58
59
59
## Interactions with other plugins
60
60
@@ -68,26 +68,34 @@ Passing a function as a value for a setting (which some of the settings below re
68
68
69
69
### `svelte3/ignore-warnings`
70
70
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.
72
72
73
73
The default is to not ignore any warnings.
74
74
75
75
### `svelte3/compiler-options`
76
76
77
77
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.
78
78
79
-
This can be an object of compiler options.
79
+
This setting can be given an object of compiler options.
80
80
81
81
The default is to compile with `{ generate: false }`.
82
82
83
83
### `svelte3/ignore-styles`
84
84
85
85
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.
86
86
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.
88
88
89
89
The default is to not ignore any styles.
90
90
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
+
91
99
## Using the CLI
92
100
93
101
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