# block-lang

Rule `vue/block-lang`. Disallow use other than available `lang`

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1818 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/block-lang` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/block-lang.html) |
| Biome | `nursery/useConsistentBlockLang` | no | unsafe | group nursery, since 2.6.0 | [docs](https://biomejs.dev/linter/rules/use-consistent-block-lang/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script>
</script>
```

```vue
<script lang="js">
</script>
```

```vue
<template>
  <div />
</template>
```

### Correct: the rule accepts this

```vue
<script lang="ts">
</script>
```

```vue
<script>
</script>
```

```vue
<template>
  <div />
</template>

<script setup lang="ts">
</script>
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/block-lang": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useConsistentBlockLang": "error"
      }
    }
  }
}
```

## Related rules

- [vue/camelcase](https://lintradar.dev/rules/vue/camelcase.md): Enforce camelcase naming convention in `<template>`
- [vue/component-api-style](https://lintradar.dev/rules/vue/component-api-style.md): Enforce component API style
- [vue/html-button-has-type](https://lintradar.dev/rules/vue/html-button-has-type.md): Disallow usage of button without an explicit type attribute
- [vue/match-component-file-name](https://lintradar.dev/rules/vue/match-component-file-name.md): Require component name property to match its file name
- [vue/no-console](https://lintradar.dev/rules/vue/no-console.md): Disallow the use of `console` in `<template>`
- [vue/no-constant-condition](https://lintradar.dev/rules/vue/no-constant-condition.md): Disallow constant expressions in conditions in `<template>`

---

Web page: https://lintradar.dev/rules/vue/block-lang. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
