html/deprecated-element
Disallow deprecated HTML elements.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
happy-path, nuxt, ecosystem, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The center element uses a deprecated HTML presentation element.
<template>
<center>Profile</center>
</template>
Good
A section and a styling class replace the deprecated element while preserving the content.
<template>
<section class="profile">Profile</section>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"html/deprecated-element": "warn"
}
},
});
Then run vp run lint.