Back to Biomejs

useVueVapor

src/content/docs/linter/rules/use-vue-vapor.mdx

latest1.9 KB
Original Source

import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs> <TabItem label="HTML" icon="seti:html"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.3.11` - Diagnostic Category: [`lint/nursery/useVueVapor`](/reference/diagnostics#diagnostic-category) - This rule has an [**unsafe**](/linter/#unsafe-fixes) fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - This rule belongs to the following domains: - [`vue`](/linter/domains#vue) ## How to configure ```json title="biome.json" { "linter": { "rules": { "nursery": { "useVueVapor": "error" } } } }
## Description
Enforce opting in to Vue Vapor mode in `<script setup>` blocks.

Vue 3.6 introduces an opt-in “Vapor mode” for SFC `<script setup>` blocks:
`<script setup vapor>`.

Vapor mode only works for Vue Single File Components (SFCs) using `<script setup>`.

This rule reports `<script setup>` opening tags that are missing the `vapor` attribute.

## Examples

### Invalid

```vue
<script setup>
</script>
<pre class="language-text"><code class="language-text"></code></pre>

Valid

vue
<script setup vapor>
</script>
  • noVueOptionsApi: Disallows the Options API format, which is incompatible with Vapor Mode
</TabItem> </Tabs>