Skip to content

Commit

Permalink
docs(valid-style-parse): documented the rule
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Feb 6, 2025
1 parent 269e66e commit a591826
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions docs/rules/valid-style-parse.md
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)

0 comments on commit a591826

Please sign in to comment.