html/no-duplicate-dt
Disallow duplicate <dt> names in <dl>.
| 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 same definition list repeats the API term for two descriptions.
<template>
<dl>
<dt>API</dt>
<dd>Public interface</dd>
<dt>API</dt>
<dd>Internal service</dd>
</dl>
</template>
Good
One API term is followed by both descriptions, avoiding the repeated term.
<template>
<dl>
<dt>API</dt>
<dd>Public interface</dd>
<dd>Internal service</dd>
</dl>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"html/no-duplicate-dt": "warn"
}
},
});
Then run vp run lint.