Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(root): add eslint a11y plugin #7917

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ const config = {
__OPENMCT_REVISION__: 'readonly',
__OPENMCT_BUILD_BRANCH__: 'readonly'
},
plugins: ['prettier', 'unicorn', 'simple-import-sort'],
plugins: ['prettier', 'unicorn', 'simple-import-sort', 'vuejs-accessibility'],
extends: [
'eslint:recommended',
'plugin:compat/recommended',
'plugin:vue/vue3-recommended',
'plugin:you-dont-need-lodash-underscore/compatible',
'plugin:prettier/recommended',
'plugin:no-unsanitized/DOM'
'plugin:no-unsanitized/DOM',
'plugin:vuejs-accessibility/recommended'
],
parser: 'vue-eslint-parser',
parserOptions: {
Expand Down Expand Up @@ -167,7 +168,20 @@ const config = {
'vue/first-attribute-linebreak': 'error',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/no-mutating-props': 'off' // TODO: Remove this rule and fix resulting errors
'vue/no-mutating-props': 'off', // TODO: Remove this rule and fix resulting errors
// TODO: A11y rules -> fix step by step
'vuejs-accessibility/no-static-element-interactions': 'warn',
'vuejs-accessibility/click-events-have-key-events': 'off',
'vuejs-accessibility/interactive-supports-focus': 'off',
// Bug in the eslint rule when using :for and :id instead of static classes
'vuejs-accessibility/label-has-for': 'off',
'vuejs-accessibility/mouse-events-have-key-events': 'off',
'vuejs-accessibility/role-has-required-aria-props': 'off',
'vuejs-accessibility/anchor-has-content': 'off',
'vuejs-accessibility/iframe-has-title': 'off',
'vuejs-accessibility/form-control-has-label': 'off',
'vuejs-accessibility/alt-text': 'off',
'vuejs-accessibility/aria-props': 'off'
},
overrides: [
{
Expand Down
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-unicorn": "49.0.0",
"eslint-plugin-vue": "9.22.0",
"eslint-plugin-vuejs-accessibility": "^2.4.1",
"eslint-plugin-you-dont-need-lodash-underscore": "6.13.0",
"eventemitter3": "5.0.1",
"file-saver": "2.0.5",
Expand Down
Loading