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
+1-1
Original file line number
Diff line number
Diff line change
@@ -354,7 +354,7 @@ These rules relate to better ways of doing things to help you avoid problems:
354
354
355
355
| Rule ID | Description ||
356
356
|:--------|:------------|:---|
357
-
|[svelte/block-lang](https://sveltejs.github.io/eslint-plugin-svelte/rules/block-lang/)| disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks. ||
357
+
|[svelte/block-lang](https://sveltejs.github.io/eslint-plugin-svelte/rules/block-lang/)| disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks. |:bulb:|
358
358
|[svelte/button-has-type](https://sveltejs.github.io/eslint-plugin-svelte/rules/button-has-type/)| disallow usage of button without an explicit type attribute ||
359
359
|[svelte/no-at-debug-tags](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-debug-tags/)| disallow the use of `{@debug}`|:star:|
360
360
|[svelte/no-ignored-unsubscribe](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-ignored-unsubscribe/)| disallow ignoring the unsubscribe method returned by the `subscribe()` on Svelte stores. ||
|[svelte/block-lang](./rules/block-lang.md)| disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks. ||
54
+
|[svelte/block-lang](./rules/block-lang.md)| disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks. |:bulb:|
55
55
|[svelte/button-has-type](./rules/button-has-type.md)| disallow usage of button without an explicit type attribute ||
56
56
|[svelte/no-at-debug-tags](./rules/no-at-debug-tags.md)| disallow the use of `{@debug}`|:star:|
57
57
|[svelte/no-ignored-unsubscribe](./rules/no-ignored-unsubscribe.md)| disallow ignoring the unsubscribe method returned by the `subscribe()` on Svelte stores. ||
Copy file name to clipboardExpand all lines: docs/rules/block-lang.md
+2
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ since: 'v2.18.0'
10
10
11
11
> disallows the use of languages other than those specified in the configuration for the lang attribute of `<script>` and `<style>` blocks.
12
12
13
+
-:bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
14
+
13
15
## :book: Rule Details
14
16
15
17
This rule enforces all svelte components to use the same set of languages for their scripts and styles.
Copy file name to clipboardExpand all lines: packages/eslint-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/multiple/javascript01-errors.yaml
+7-1
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,10 @@
2
2
one of "ts", "typescript".
3
3
line: 1
4
4
column: 1
5
-
suggestions: null
5
+
suggestions:
6
+
- desc: Replace a <script> block with the lang attribute set to "ts".
7
+
output: |
8
+
<script lang="ts"></script>
9
+
- desc: Replace a <script> block with the lang attribute set to "typescript".
Copy file name to clipboardExpand all lines: packages/eslint-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/multiple/null-as-style-lang01-errors.yaml
+11-1
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,14 @@
2
2
one of "ts", "typescript".
3
3
line: 1
4
4
column: 1
5
-
suggestions: null
5
+
suggestions:
6
+
- desc: Replace a <script> block with the lang attribute set to "ts".
7
+
output: |
8
+
<script lang="ts"></script>
9
+
10
+
<style></style>
11
+
- desc: Replace a <script> block with the lang attribute set to "typescript".
Copy file name to clipboardExpand all lines: packages/eslint-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/multiple/ts-as-style-lang01-errors.yaml
+11-1
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,14 @@
2
2
one of "ts", "typescript".
3
3
line: 1
4
4
column: 1
5
-
suggestions: null
5
+
suggestions:
6
+
- desc: Replace a <script> block with the lang attribute set to "ts".
7
+
output: |
8
+
<script lang="ts"></script>
9
+
10
+
<style lang="ts"></style>
11
+
- desc: Replace a <script> block with the lang attribute set to "typescript".
0 commit comments