# svelte/valid-style-parse

require valid style element parsing

# 📖 Rule Details

This rule reports issues with parsing of the <style> element by the svelte-eslint-parser.

<script>
  /* eslint svelte/valid-style-parse: ["error"] */
</script>

<!-- ✓ GOOD -->
<style>
  .class {
    font-weight: bold;
  }
</style>
<script>
  /* eslint svelte/valid-style-parse: ["error"] */
</script>

<!-- ✓ GOOD -->
<style lang="scss">
  .class {
    font-weight: bold;
  }
</style>
<script>
  /* eslint svelte/valid-style-parse: ["error"] */
</script>

<!-- ✗ BAD -->
Error parsing style element. Error message: "+page.svelte:3:5: Unknown word font-weight" (svelte/valid-style-parse)
<style>
.class font-weight: bold; </style>
<script>
  /* eslint svelte/valid-style-parse: ["error"] */
</script>

<!-- ✗ BAD -->
Found unsupported style element language "unknown" (svelte/valid-style-parse)
<style lang="unknown">
.class { font-weight: bold; } </style>

# 🔧 Options

Nothing.

# 🚀 Version

This rule was introduced in eslint-plugin-svelte v3.0.0

# 🔍 Implementation