An eslint
plugin for checking accessibility rules from within .vue
files.
Add vuejs-accessibility
to the plugins section of your eslint
configuration. You can omit the eslint-plugin-
prefix:
{
"plugins": ["vuejs-accessibility"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"vuejs-accessibility/rule-name": "error"
}
}
You can also enable all the recommended rules at once. Add plugin:vuejs-accessibility/recommended
in extends:
{
"extends": ["plugin:vuejs-accessibility/recommended"]
}
Ensure you have node
and yarn
installed on your system. Then run yarn
in the root of the repository to install the dependencies.
To add a new rule, you need to take the following steps:
src/index.js
.src/rules
.src/rules/__tests__
.docs/rules
.Bug reports and pull requests are welcome on GitHub at https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility.
The code is available as open source under the terms of the MIT License.
The work for this plugin was largely based on previous work done on eslint-plugin-vue-a11y, as well as various other tools, including:
Author: vue-a11y
Source Code: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility
#vuejs #vue #javascript