Skip to content
This repository was archived by the owner on Jun 29, 2025. It is now read-only.

Commit 6dd4f37

Browse files
Conrad2134tclindner
authored andcommitted
eslint-plugin-vue-a11y (#14)
* Showing what the vue-a11y plugin defaults would look like * Fixing prettier rule
1 parent 0aa401f commit 6dd4f37

File tree

5 files changed

+218
-6
lines changed

5 files changed

+218
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ npx install-peerdeps --dev eslint-config-vue-tc
3131

3232
> eslint and eslint-plugin-vue are peer dependencies and must be installed.
3333
34-
**This module works best when paired with [`eslint-config-tc`](https://github.com/tclindner/eslint-config-tc). Please follow it's install instructions.**
34+
**This module works best when paired with [`eslint-config-tc`](https://github.com/tclindner/eslint-config-tc). Please follow its install instructions.**
3535

3636
## Usage
3737

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const vue = require.resolve('./rules/vue');
2+
const a11y = require.resolve('./rules/a11y');
23

34
module.exports = {
4-
extends: ['plugin:vue/recommended', vue],
5+
extends: ['plugin:vue/recommended', vue, a11y],
56
parserOptions: {
67
parser: 'babel-eslint'
78
},
8-
plugins: ['vue'],
9+
plugins: ['vue', 'vue-a11y'],
910
env: {
1011
es6: true
1112
}

package-lock.json

Lines changed: 181 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"eslint-plugin-jest": "^22.15.0",
4444
"eslint-plugin-prettier": "^3.1.0",
4545
"eslint-plugin-vue": "^5.2.3",
46+
"eslint-plugin-vue-a11y": "^0.0.31",
4647
"is-plain-obj": "^2.0.0",
4748
"jest": "^24.8.0",
4849
"npm-package-json-lint": "^3.7.0",
@@ -51,7 +52,8 @@
5152
},
5253
"peerDependencies": {
5354
"eslint": "^6.1.0",
54-
"eslint-plugin-vue": "^5.2.3"
55+
"eslint-plugin-vue": "^5.2.3",
56+
"eslint-plugin-vue-a11y": "^0.0.31"
5557
},
5658
"engines": {
5759
"node": ">=8.0.0",

rules/a11y.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
rules: {
3+
'vue-a11y/accessible-emoji': 'error',
4+
'vue-a11y/alt-text': 'error',
5+
'vue-a11y/anchor-has-content': 'error',
6+
'vue-a11y/aria-role': [
7+
2,
8+
{
9+
ignoreNonDOM: true
10+
}
11+
],
12+
'vue-a11y/aria-props': 'error',
13+
'vue-a11y/aria-unsupported-elements': 'error',
14+
'vue-a11y/click-events-have-key-events': 'error',
15+
'vue-a11y/form-has-label': 'error',
16+
'vue-a11y/heading-has-content': 'error',
17+
'vue-a11y/iframe-has-title': 'error',
18+
'vue-a11y/interactive-supports-focus': 'error',
19+
'vue-a11y/label-has-for': 'error',
20+
'vue-a11y/media-has-caption': 'error',
21+
'vue-a11y/mouse-events-have-key-events': 'error',
22+
'vue-a11y/no-access-key': 'error',
23+
'vue-a11y/no-autofocus': 'error',
24+
'vue-a11y/no-distracting-elements': 'error',
25+
'vue-a11y/no-onchange': 'error',
26+
'vue-a11y/no-redundant-roles': 'error',
27+
'vue-a11y/role-has-required-aria-props': 'error',
28+
'vue-a11y/tabindex-no-positive': 'error'
29+
}
30+
};

0 commit comments

Comments
 (0)