vue/no-template-lang
Discourage lang attribute on template block.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
nuxt, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The template selects Pug through lang, so the HTML-only policy reports the authored block.
<template lang="pug">
p Notice
</template>
Good
An ordinary HTML template omits lang and uses the paragraph directly.
<template>
<p>Notice</p>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-template-lang": "warn"
}
},
});
Then run vp run lint.