Skip to content

Commit 2ee6d7d

Browse files
committed
docs(valid-style-parse): documented the rule
1 parent 269e66e commit 2ee6d7d

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

docs/rules/valid-style-parse.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
pageClass: 'rule-details'
3+
sidebarDepth: 0
4+
title: 'svelte/valid-style-parse'
5+
description: 'require valid style element parsing'
6+
---
7+
8+
# svelte/valid-style-parse
9+
10+
> require valid style element parsing
11+
12+
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> **_This rule has not been released yet._** </badge>
13+
14+
## :book: Rule Details
15+
16+
This rule reports issues with parsing of the `<style>` element by the svelte-eslint-parser.
17+
18+
<!--eslint-skip-->
19+
20+
```svelte
21+
<script>
22+
/* eslint svelte/valid-style-parse: ["error"] */
23+
</script>
24+
25+
<!-- ✓ GOOD -->
26+
<style>
27+
.class {
28+
font-weight: bold;
29+
}
30+
</style>
31+
```
32+
33+
```svelte
34+
<script>
35+
/* eslint svelte/valid-style-parse: ["error"] */
36+
</script>
37+
38+
<!-- ✓ GOOD -->
39+
<style lang="scss">
40+
.class {
41+
font-weight: bold;
42+
}
43+
</style>
44+
```
45+
46+
```svelte
47+
<script>
48+
/* eslint svelte/valid-style-parse: ["error"] */
49+
</script>
50+
51+
<!-- ✗ BAD -->
52+
<style>
53+
.class
54+
font-weight: bold;
55+
</style>
56+
```
57+
58+
```svelte
59+
<script>
60+
/* eslint svelte/valid-style-parse: ["error"] */
61+
</script>
62+
63+
<!-- ✗ BAD -->
64+
<style lang="unknown">
65+
.class {
66+
font-weight: bold;
67+
}
68+
</style>
69+
```
70+
71+
## :wrench: Options
72+
73+
Nothing.
74+
75+
## :mag: Implementation
76+
77+
- [Rule source](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/src/rules/valid-style-parse.ts)
78+
- [Test source](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/tests/src/rules/valid-style-parse.ts)

0 commit comments

Comments
 (0)