Skip to content

Commit 1b9074b

Browse files
committed
docs(block-lang): added enforcing
1 parent 3a5eece commit 1b9074b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/rules/block-lang.md

+4
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,17 @@ This rule enforces all svelte components to use the same set of languages for th
6464
"svelte/block-lang": [
6565
"error",
6666
{
67+
"enforceScriptPresent": true,
68+
"enforceStylePresent": false,
6769
"script": ["ts", null], // a list of languages or null to signify no language specified
6870
"style": "scss" // same as for script, a single value can be used instead of an array.
6971
}
7072
]
7173
}
7274
```
7375

76+
- `enforceScriptPresent` ... Whether to enforce the presence of a `<script>` block with one of the given languages. This may be useful as for example TypeScript checks some uses of a component if it is defined as being TypeScript. Default `false`.
77+
- `enforceStylePresent` ... Whether to enforce the presence of a `<style>` block with one of the given languages. Default `false`.
7478
- `script` ... A list of languages allowed for the `<script>` block. If `null` is included, no `lang` attribute is also allowed. A plain string or `null` can be used instead of one-item array. Default `null`.
7579
- `style` ... A list of languages allowed for the `<style>` block. If `null` is included, no `lang` attribute is also allowed. A plain string or `null` can be used instead of one-item array. Default `null`.
7680

0 commit comments

Comments
 (0)