Skip to content

Commit f727eec

Browse files
committed
update readme
1 parent 232e173 commit f727eec

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ This setting can be given a function that accepts an object of attributes on a `
8888

8989
The default is to not ignore any styles.
9090

91+
### `svelte3/named-blocks`
92+
93+
When an [ESLint processor](https://eslint.org/docs/user-guide/configuring#specifying-processor) processes a file, it is able to output named code blocks, which can each have their own linting configuration. When this setting is enabled, the code extracted from `<script context='module>` tag, the `<script>` tag, and the template are respectively given the block names `module.js`, `instance.js`, and `template.js`.
94+
95+
This means that to override linting rules in Svelte components, you'd instead have to target `**/*.svelte/*.js`. But it also means that you can define an override targeting `**/*.svelte/*_template.js` for example, and that configuration will only apply to linting done on the templates in Svelte components.
96+
97+
The default is to not use named code blocks.
98+
9199
### `svelte3/compiler`
92100

93101
In some esoteric setups, this plugin might not be able to find the correct instance of the Svelte compiler to use.
@@ -96,10 +104,6 @@ This setting can be given the result of `require('.../path/to/svelte/compiler')`
96104

97105
The default is `require('svelte/compiler')` from wherever the plugin is installed to.
98106

99-
## Named code blocks
100-
101-
When an [ESLint processor](https://eslint.org/docs/user-guide/configuring#specifying-processor) processes a file, it is able to output named code blocks, which can each have their own linting configuration. In this plugin, the code extracted from `<script context='module>` tag, the `<script>` tag, and the template are respectively given the block names `module.js`, `instance.js`, and `template.js`. This means that you can define an override targeting `**/*.svelte/*_template.js` for example, and that configuration will only apply to linting done on the templates in Svelte components.
102-
103107
## Using the CLI
104108

105109
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)