a11y/aria-props
Disallow invalid ARIA attributes.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
error |
happy-path, nuxt, ecosystem, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
aria-lable is misspelled and is not a supported ARIA attribute.
<template>
<button aria-lable="Save changes">Save</button>
</template>
Good
The supported aria-label attribute supplies the button name.
<template>
<button aria-label="Save changes">Save</button>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"a11y/aria-props": "error"
}
},
});
Then run vp run lint.