summaryrefslogtreecommitdiffstats
path: root/.eslintrc.js
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-01-30 00:18:12 -0500
committerGitHub <noreply@github.com>2023-01-30 14:18:12 +0900
commit96d26a941782f071e436f34c75e91c36462579d6 (patch)
tree3b40311986a890ca45f6c5fb2f08498c5b3768ca /.eslintrc.js
parent1032d456445a2c1479a1ed3f69c9f724e31ff71b (diff)
Enable ESLint jsx-a11y/recommended ruleset (#23309)
Diffstat (limited to '.eslintrc.js')
-rw-r--r--.eslintrc.js73
1 files changed, 35 insertions, 38 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 66057fb7357..ca7fc83eb90 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -4,6 +4,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
+ 'plugin:jsx-a11y/recommended',
],
env: {
@@ -124,40 +125,30 @@ module.exports = {
'react/no-unknown-property': 'off',
'react/self-closing-comp': 'error',
+ // recommended values found in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js
'jsx-a11y/accessible-emoji': 'warn',
- 'jsx-a11y/alt-text': 'warn',
- 'jsx-a11y/anchor-has-content': 'warn',
- 'jsx-a11y/anchor-is-valid': [
- 'warn',
- {
- components: [
- 'Link',
- 'NavLink',
- ],
- specialLink: [
- 'to',
- ],
- aspect: [
- 'noHref',
- 'invalidHref',
- 'preferButton',
- ],
- },
- ],
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
- 'jsx-a11y/aria-props': 'warn',
- 'jsx-a11y/aria-proptypes': 'warn',
- 'jsx-a11y/aria-role': 'warn',
- 'jsx-a11y/aria-unsupported-elements': 'warn',
- 'jsx-a11y/heading-has-content': 'warn',
- 'jsx-a11y/html-has-lang': 'warn',
- 'jsx-a11y/iframe-has-title': 'warn',
- 'jsx-a11y/img-redundant-alt': 'warn',
- 'jsx-a11y/interactive-supports-focus': 'warn',
- 'jsx-a11y/label-has-for': 'off',
- 'jsx-a11y/mouse-events-have-key-events': 'warn',
- 'jsx-a11y/no-access-key': 'warn',
- 'jsx-a11y/no-distracting-elements': 'warn',
+ 'jsx-a11y/click-events-have-key-events': 'off',
+ 'jsx-a11y/label-has-associated-control': 'off',
+ 'jsx-a11y/media-has-caption': 'off',
+ 'jsx-a11y/no-autofocus': 'off',
+ // recommended rule is:
+ // 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
+ // 'error',
+ // {
+ // tr: ['none', 'presentation'],
+ // canvas: ['img'],
+ // },
+ // ],
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off',
+ // recommended rule is:
+ // 'jsx-a11y/no-noninteractive-element-interactions': [
+ // 'error',
+ // {
+ // body: ['onError', 'onLoad'],
+ // iframe: ['onError', 'onLoad'],
+ // img: ['onError', 'onLoad'],
+ // },
+ // ],
'jsx-a11y/no-noninteractive-element-interactions': [
'warn',
{
@@ -166,8 +157,18 @@ module.exports = {
],
},
],
+ // recommended rule is:
+ // 'jsx-a11y/no-noninteractive-tabindex': [
+ // 'error',
+ // {
+ // tags: [],
+ // roles: ['tabpanel'],
+ // allowExpressionValues: true,
+ // },
+ // ],
+ 'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/no-onchange': 'warn',
- 'jsx-a11y/no-redundant-roles': 'warn',
+ // recommended is full 'error'
'jsx-a11y/no-static-element-interactions': [
'warn',
{
@@ -176,10 +177,6 @@ module.exports = {
],
},
],
- 'jsx-a11y/role-has-required-aria-props': 'warn',
- 'jsx-a11y/role-supports-aria-props': 'off',
- 'jsx-a11y/scope': 'warn',
- 'jsx-a11y/tabindex-no-positive': 'warn',
'import/extensions': [
'error',