-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(valid-style-parse): documented the rule
- Loading branch information
1 parent
269e66e
commit a591826
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
pageClass: 'rule-details' | ||
sidebarDepth: 0 | ||
title: 'svelte/valid-style-parse' | ||
description: 'require valid style element parsing' | ||
--- | ||
|
||
# svelte/valid-style-parse | ||
|
||
> require valid style element parsing | ||
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> **_This rule has not been released yet._** </badge> | ||
|
||
## :book: Rule Details | ||
|
||
This rule reports issues with parsing of the `<style>` element by the svelte-eslint-parser. | ||
|
||
<!--eslint-skip--> | ||
|
||
```svelte | ||
<script> | ||
/* eslint svelte/valid-style-parse: ["error"] */ | ||
</script> | ||
<!-- ✓ GOOD --> | ||
<style> | ||
.class { | ||
font-weight: bold; | ||
} | ||
</style> | ||
``` | ||
|
||
```svelte | ||
<script> | ||
/* eslint svelte/valid-style-parse: ["error"] */ | ||
</script> | ||
<!-- ✓ GOOD --> | ||
<style lang="scss"> | ||
.class { | ||
font-weight: bold; | ||
} | ||
</style> | ||
``` | ||
|
||
```svelte | ||
<script> | ||
/* eslint svelte/valid-style-parse: ["error"] */ | ||
</script> | ||
<!-- ✗ BAD --> | ||
<style> | ||
.class | ||
font-weight: bold; | ||
</style> | ||
``` | ||
|
||
```svelte | ||
<script> | ||
/* eslint svelte/valid-style-parse: ["error"] */ | ||
</script> | ||
<!-- ✗ BAD --> | ||
<style lang="unknown"> | ||
.class { | ||
font-weight: bold; | ||
} | ||
</style> | ||
``` | ||
|
||
## :wrench: Options | ||
|
||
Nothing. | ||
|
||
## :mag: Implementation | ||
|
||
- [Rule source](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/src/rules/valid-style-parse.ts) | ||
- [Test source](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/tests/src/rules/valid-style-parse.ts) |