Bump version
This commit is contained in:
@ -1,10 +1,16 @@
|
||||
diff --git a/src/index.js b/src/index.js
|
||||
index 752ff61..99a42a3 100644
|
||||
index 2fa185f..627af9b 100644
|
||||
--- a/src/index.js
|
||||
+++ b/src/index.js
|
||||
@@ -1,70 +1,110 @@
|
||||
@@ -1,48 +1,90 @@
|
||||
/* eslint-disable global-require */
|
||||
+// @ts-check
|
||||
-const flatConfigBase = require('./configs/flat-config-base');
|
||||
-const legacyConfigBase = require('./configs/legacy-config-base');
|
||||
-const { name, version } = require('../package.json');
|
||||
+import flatConfigBase from './configs/flat-config-base';
|
||||
+import legacyConfigBase from './configs/legacy-config-base';
|
||||
+import { name, version } from '../package.json';
|
||||
+
|
||||
+import accessibleEmoji from './rules/accessible-emoji';
|
||||
+import altText from './rules/alt-text';
|
||||
+import anchorAmbiguousText from './rules/anchor-ambiguous-text';
|
||||
@ -45,504 +51,181 @@ index 752ff61..99a42a3 100644
|
||||
+import scope from './rules/scope';
|
||||
+import tabindexNoPositive from './rules/tabindex-no-positive';
|
||||
|
||||
-module.exports = {
|
||||
- rules: {
|
||||
- 'accessible-emoji': require('./rules/accessible-emoji'),
|
||||
- 'alt-text': require('./rules/alt-text'),
|
||||
- 'anchor-ambiguous-text': require('./rules/anchor-ambiguous-text'),
|
||||
- 'anchor-has-content': require('./rules/anchor-has-content'),
|
||||
- 'anchor-is-valid': require('./rules/anchor-is-valid'),
|
||||
- 'aria-activedescendant-has-tabindex': require('./rules/aria-activedescendant-has-tabindex'),
|
||||
- 'aria-props': require('./rules/aria-props'),
|
||||
- 'aria-proptypes': require('./rules/aria-proptypes'),
|
||||
- 'aria-role': require('./rules/aria-role'),
|
||||
- 'aria-unsupported-elements': require('./rules/aria-unsupported-elements'),
|
||||
- 'autocomplete-valid': require('./rules/autocomplete-valid'),
|
||||
- 'click-events-have-key-events': require('./rules/click-events-have-key-events'),
|
||||
- 'control-has-associated-label': require('./rules/control-has-associated-label'),
|
||||
- 'heading-has-content': require('./rules/heading-has-content'),
|
||||
- 'html-has-lang': require('./rules/html-has-lang'),
|
||||
- 'iframe-has-title': require('./rules/iframe-has-title'),
|
||||
- 'img-redundant-alt': require('./rules/img-redundant-alt'),
|
||||
- 'interactive-supports-focus': require('./rules/interactive-supports-focus'),
|
||||
- 'label-has-associated-control': require('./rules/label-has-associated-control'),
|
||||
- 'label-has-for': require('./rules/label-has-for'),
|
||||
- lang: require('./rules/lang'),
|
||||
- 'media-has-caption': require('./rules/media-has-caption'),
|
||||
- 'mouse-events-have-key-events': require('./rules/mouse-events-have-key-events'),
|
||||
- 'no-access-key': require('./rules/no-access-key'),
|
||||
- 'no-aria-hidden-on-focusable': require('./rules/no-aria-hidden-on-focusable'),
|
||||
- 'no-autofocus': require('./rules/no-autofocus'),
|
||||
- 'no-distracting-elements': require('./rules/no-distracting-elements'),
|
||||
- 'no-interactive-element-to-noninteractive-role': require('./rules/no-interactive-element-to-noninteractive-role'),
|
||||
- 'no-noninteractive-element-interactions': require('./rules/no-noninteractive-element-interactions'),
|
||||
- 'no-noninteractive-element-to-interactive-role': require('./rules/no-noninteractive-element-to-interactive-role'),
|
||||
- 'no-noninteractive-tabindex': require('./rules/no-noninteractive-tabindex'),
|
||||
- 'no-onchange': require('./rules/no-onchange'),
|
||||
- 'no-redundant-roles': require('./rules/no-redundant-roles'),
|
||||
- 'no-static-element-interactions': require('./rules/no-static-element-interactions'),
|
||||
- 'prefer-tag-over-role': require('./rules/prefer-tag-over-role'),
|
||||
- 'role-has-required-aria-props': require('./rules/role-has-required-aria-props'),
|
||||
- 'role-supports-aria-props': require('./rules/role-supports-aria-props'),
|
||||
- scope: require('./rules/scope'),
|
||||
- 'tabindex-no-positive': require('./rules/tabindex-no-positive'),
|
||||
- },
|
||||
- configs: {
|
||||
- recommended: {
|
||||
- plugins: [
|
||||
- 'jsx-a11y',
|
||||
- ],
|
||||
- parserOptions: {
|
||||
- ecmaFeatures: {
|
||||
- jsx: true,
|
||||
- },
|
||||
+export const rules = kebabCase({
|
||||
+ accessibleEmoji,
|
||||
+ altText,
|
||||
+ anchorAmbiguousText,
|
||||
+ anchorHasContent,
|
||||
+ anchorIsValid,
|
||||
+ ariaActivedescendantHasTabindex,
|
||||
+ ariaProps,
|
||||
+ ariaProptypes,
|
||||
+ ariaRole,
|
||||
+ ariaUnsupportedElements,
|
||||
+ autocompleteValid,
|
||||
+ clickEventsHaveKeyEvents,
|
||||
+ controlHasAssociatedLabel,
|
||||
+ headingHasContent,
|
||||
+ htmlHasLang,
|
||||
+ iframeHasTitle,
|
||||
+ imgRedundantAlt,
|
||||
+ interactiveSupportsFocus,
|
||||
+ labelHasAssociatedControl,
|
||||
+ labelHasFor,
|
||||
const allRules = {
|
||||
- 'accessible-emoji': require('./rules/accessible-emoji'),
|
||||
- 'alt-text': require('./rules/alt-text'),
|
||||
- 'anchor-ambiguous-text': require('./rules/anchor-ambiguous-text'),
|
||||
- 'anchor-has-content': require('./rules/anchor-has-content'),
|
||||
- 'anchor-is-valid': require('./rules/anchor-is-valid'),
|
||||
- 'aria-activedescendant-has-tabindex': require('./rules/aria-activedescendant-has-tabindex'),
|
||||
- 'aria-props': require('./rules/aria-props'),
|
||||
- 'aria-proptypes': require('./rules/aria-proptypes'),
|
||||
- 'aria-role': require('./rules/aria-role'),
|
||||
- 'aria-unsupported-elements': require('./rules/aria-unsupported-elements'),
|
||||
- 'autocomplete-valid': require('./rules/autocomplete-valid'),
|
||||
- 'click-events-have-key-events': require('./rules/click-events-have-key-events'),
|
||||
- 'control-has-associated-label': require('./rules/control-has-associated-label'),
|
||||
- 'heading-has-content': require('./rules/heading-has-content'),
|
||||
- 'html-has-lang': require('./rules/html-has-lang'),
|
||||
- 'iframe-has-title': require('./rules/iframe-has-title'),
|
||||
- 'img-redundant-alt': require('./rules/img-redundant-alt'),
|
||||
- 'interactive-supports-focus': require('./rules/interactive-supports-focus'),
|
||||
- 'label-has-associated-control': require('./rules/label-has-associated-control'),
|
||||
- 'label-has-for': require('./rules/label-has-for'),
|
||||
- lang: require('./rules/lang'),
|
||||
- 'media-has-caption': require('./rules/media-has-caption'),
|
||||
- 'mouse-events-have-key-events': require('./rules/mouse-events-have-key-events'),
|
||||
- 'no-access-key': require('./rules/no-access-key'),
|
||||
- 'no-aria-hidden-on-focusable': require('./rules/no-aria-hidden-on-focusable'),
|
||||
- 'no-autofocus': require('./rules/no-autofocus'),
|
||||
- 'no-distracting-elements': require('./rules/no-distracting-elements'),
|
||||
- 'no-interactive-element-to-noninteractive-role': require('./rules/no-interactive-element-to-noninteractive-role'),
|
||||
- 'no-noninteractive-element-interactions': require('./rules/no-noninteractive-element-interactions'),
|
||||
- 'no-noninteractive-element-to-interactive-role': require('./rules/no-noninteractive-element-to-interactive-role'),
|
||||
- 'no-noninteractive-tabindex': require('./rules/no-noninteractive-tabindex'),
|
||||
- 'no-onchange': require('./rules/no-onchange'),
|
||||
- 'no-redundant-roles': require('./rules/no-redundant-roles'),
|
||||
- 'no-static-element-interactions': require('./rules/no-static-element-interactions'),
|
||||
- 'prefer-tag-over-role': require('./rules/prefer-tag-over-role'),
|
||||
- 'role-has-required-aria-props': require('./rules/role-has-required-aria-props'),
|
||||
- 'role-supports-aria-props': require('./rules/role-supports-aria-props'),
|
||||
- scope: require('./rules/scope'),
|
||||
- 'tabindex-no-positive': require('./rules/tabindex-no-positive'),
|
||||
+ 'accessible-emoji': accessibleEmoji,
|
||||
+ 'alt-text': altText,
|
||||
+ 'anchor-ambiguous-text': anchorAmbiguousText,
|
||||
+ 'anchor-has-content': anchorHasContent,
|
||||
+ 'anchor-is-valid': anchorIsValid,
|
||||
+ 'aria-activedescendant-has-tabindex': ariaActivedescendantHasTabindex,
|
||||
+ 'aria-props': ariaProps,
|
||||
+ 'aria-proptypes': ariaProptypes,
|
||||
+ 'aria-role': ariaRole,
|
||||
+ 'aria-unsupported-elements': ariaUnsupportedElements,
|
||||
+ 'autocomplete-valid': autocompleteValid,
|
||||
+ 'click-events-have-key-events': clickEventsHaveKeyEvents,
|
||||
+ 'control-has-associated-label': controlHasAssociatedLabel,
|
||||
+ 'heading-has-content': headingHasContent,
|
||||
+ 'html-has-lang': htmlHasLang,
|
||||
+ 'iframe-has-title': iframeHasTitle,
|
||||
+ 'img-redundant-alt': imgRedundantAlt,
|
||||
+ 'interactive-supports-focus': interactiveSupportsFocus,
|
||||
+ 'label-has-associated-control': labelHasAssociatedControl,
|
||||
+ 'label-has-for': labelHasFor,
|
||||
+ lang,
|
||||
+ mediaHasCaption,
|
||||
+ mouseEventsHaveKeyEvents,
|
||||
+ noAccessKey,
|
||||
+ noAriaHiddenOnFocusable,
|
||||
+ noAutofocus,
|
||||
+ noDistractingElements,
|
||||
+ noInteractiveElementToNoninteractiveRole,
|
||||
+ noNoninteractiveElementInteractions,
|
||||
+ noNoninteractiveElementToInteractiveRole,
|
||||
+ noNoninteractiveTabindex,
|
||||
+ noOnChange,
|
||||
+ noRedundantRoles,
|
||||
+ noStaticElementInteractions,
|
||||
+ preferTagOverRole,
|
||||
+ roleHasRequiredAriaProps,
|
||||
+ roleSupportsAriaProps,
|
||||
+ 'media-has-caption': mediaHasCaption,
|
||||
+ 'mouse-events-have-key-events': mouseEventsHaveKeyEvents,
|
||||
+ 'no-access-key': noAccessKey,
|
||||
+ 'no-aria-hidden-on-focusable': noAriaHiddenOnFocusable,
|
||||
+ 'no-autofocus': noAutofocus,
|
||||
+ 'no-distracting-elements': noDistractingElements,
|
||||
+ 'no-interactive-element-to-noninteractive-role':
|
||||
+ noInteractiveElementToNoninteractiveRole,
|
||||
+ 'no-noninteractive-element-interactions': noNoninteractiveElementInteractions,
|
||||
+ 'no-noninteractive-element-to-interactive-role':
|
||||
+ noNoninteractiveElementToInteractiveRole,
|
||||
+ 'no-noninteractive-tabindex': noNoninteractiveTabindex,
|
||||
+ 'no-onchange': noOnChange,
|
||||
+ 'no-redundant-roles': noRedundantRoles,
|
||||
+ 'no-static-element-interactions': noStaticElementInteractions,
|
||||
+ 'prefer-tag-over-role': preferTagOverRole,
|
||||
+ 'role-has-required-aria-props': roleHasRequiredAriaProps,
|
||||
+ 'role-supports-aria-props': roleSupportsAriaProps,
|
||||
+ scope,
|
||||
+ tabindexNoPositive,
|
||||
+});
|
||||
+
|
||||
+export const configs = {
|
||||
+ recommended: {
|
||||
+ plugins: ['jsx-a11y'],
|
||||
+ parserOptions: {
|
||||
+ ecmaFeatures: {
|
||||
+ jsx: true,
|
||||
},
|
||||
- rules: {
|
||||
- 'jsx-a11y/alt-text': 'error',
|
||||
- 'jsx-a11y/anchor-ambiguous-text': 'off', // TODO: error
|
||||
- 'jsx-a11y/anchor-has-content': 'error',
|
||||
- 'jsx-a11y/anchor-is-valid': 'error',
|
||||
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
||||
- 'jsx-a11y/aria-props': 'error',
|
||||
- 'jsx-a11y/aria-proptypes': 'error',
|
||||
- 'jsx-a11y/aria-role': 'error',
|
||||
- 'jsx-a11y/aria-unsupported-elements': 'error',
|
||||
- 'jsx-a11y/autocomplete-valid': 'error',
|
||||
- 'jsx-a11y/click-events-have-key-events': 'error',
|
||||
- 'jsx-a11y/control-has-associated-label': ['off', {
|
||||
+ },
|
||||
+ rules: {
|
||||
+ 'jsx-a11y/alt-text': 'error',
|
||||
+ 'jsx-a11y/anchor-ambiguous-text': 'off', // TODO: error
|
||||
+ 'jsx-a11y/anchor-has-content': 'error',
|
||||
+ 'jsx-a11y/anchor-is-valid': 'error',
|
||||
+ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
||||
+ 'jsx-a11y/aria-props': 'error',
|
||||
+ 'jsx-a11y/aria-proptypes': 'error',
|
||||
+ 'jsx-a11y/aria-role': 'error',
|
||||
+ 'jsx-a11y/aria-unsupported-elements': 'error',
|
||||
+ 'jsx-a11y/autocomplete-valid': 'error',
|
||||
+ 'jsx-a11y/click-events-have-key-events': 'error',
|
||||
+ 'jsx-a11y/control-has-associated-label': [
|
||||
+ 'off',
|
||||
+ {
|
||||
ignoreElements: [
|
||||
'audio',
|
||||
'canvas',
|
||||
@@ -86,140 +126,122 @@ module.exports = {
|
||||
'tree',
|
||||
'treegrid',
|
||||
],
|
||||
- includeRoles: [
|
||||
- 'alert',
|
||||
- 'dialog',
|
||||
+ includeRoles: ['alert', 'dialog'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/heading-has-content': 'error',
|
||||
+ 'jsx-a11y/html-has-lang': 'error',
|
||||
+ 'jsx-a11y/iframe-has-title': 'error',
|
||||
+ 'jsx-a11y/img-redundant-alt': 'error',
|
||||
+ 'jsx-a11y/interactive-supports-focus': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ tabbable: [
|
||||
+ 'button',
|
||||
+ 'checkbox',
|
||||
+ 'link',
|
||||
+ 'searchbox',
|
||||
+ 'spinbutton',
|
||||
+ 'switch',
|
||||
+ 'textbox',
|
||||
],
|
||||
- }],
|
||||
- 'jsx-a11y/heading-has-content': 'error',
|
||||
- 'jsx-a11y/html-has-lang': 'error',
|
||||
- 'jsx-a11y/iframe-has-title': 'error',
|
||||
- 'jsx-a11y/img-redundant-alt': 'error',
|
||||
- 'jsx-a11y/interactive-supports-focus': [
|
||||
- 'error',
|
||||
- {
|
||||
- tabbable: [
|
||||
- 'button',
|
||||
- 'checkbox',
|
||||
- 'link',
|
||||
- 'searchbox',
|
||||
- 'spinbutton',
|
||||
- 'switch',
|
||||
- 'textbox',
|
||||
- ],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/label-has-associated-control': 'error',
|
||||
- 'jsx-a11y/label-has-for': 'off',
|
||||
- 'jsx-a11y/media-has-caption': 'error',
|
||||
- 'jsx-a11y/mouse-events-have-key-events': 'error',
|
||||
- 'jsx-a11y/no-access-key': 'error',
|
||||
- 'jsx-a11y/no-autofocus': 'error',
|
||||
- 'jsx-a11y/no-distracting-elements': 'error',
|
||||
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
|
||||
- 'error',
|
||||
- {
|
||||
- tr: ['none', 'presentation'],
|
||||
- canvas: ['img'],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/no-noninteractive-element-interactions': [
|
||||
- 'error',
|
||||
- {
|
||||
- handlers: [
|
||||
- 'onClick',
|
||||
- 'onError',
|
||||
- 'onLoad',
|
||||
- 'onMouseDown',
|
||||
- 'onMouseUp',
|
||||
- 'onKeyPress',
|
||||
- 'onKeyDown',
|
||||
- 'onKeyUp',
|
||||
- ],
|
||||
- alert: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
||||
- body: ['onError', 'onLoad'],
|
||||
- dialog: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
||||
- iframe: ['onError', 'onLoad'],
|
||||
- img: ['onError', 'onLoad'],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
|
||||
- 'error',
|
||||
- {
|
||||
- ul: [
|
||||
- 'listbox',
|
||||
- 'menu',
|
||||
- 'menubar',
|
||||
- 'radiogroup',
|
||||
- 'tablist',
|
||||
- 'tree',
|
||||
- 'treegrid',
|
||||
- ],
|
||||
- ol: [
|
||||
- 'listbox',
|
||||
- 'menu',
|
||||
- 'menubar',
|
||||
- 'radiogroup',
|
||||
- 'tablist',
|
||||
- 'tree',
|
||||
- 'treegrid',
|
||||
- ],
|
||||
- li: ['menuitem', 'menuitemradio', 'menuitemcheckbox', 'option', 'row', 'tab', 'treeitem'],
|
||||
- table: ['grid'],
|
||||
- td: ['gridcell'],
|
||||
- fieldset: ['radiogroup', 'presentation'],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/no-noninteractive-tabindex': [
|
||||
- 'error',
|
||||
- {
|
||||
- tags: [],
|
||||
- roles: ['tabpanel'],
|
||||
- allowExpressionValues: true,
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/no-redundant-roles': 'error',
|
||||
- 'jsx-a11y/no-static-element-interactions': [
|
||||
- 'error',
|
||||
- {
|
||||
- allowExpressionValues: true,
|
||||
- handlers: [
|
||||
- 'onClick',
|
||||
- 'onMouseDown',
|
||||
- 'onMouseUp',
|
||||
- 'onKeyPress',
|
||||
- 'onKeyDown',
|
||||
- 'onKeyUp',
|
||||
- ],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/role-has-required-aria-props': 'error',
|
||||
- 'jsx-a11y/role-supports-aria-props': 'error',
|
||||
- 'jsx-a11y/scope': 'error',
|
||||
- 'jsx-a11y/tabindex-no-positive': 'error',
|
||||
- },
|
||||
- },
|
||||
- strict: {
|
||||
- plugins: [
|
||||
- 'jsx-a11y',
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/label-has-associated-control': 'error',
|
||||
+ 'jsx-a11y/label-has-for': 'off',
|
||||
+ 'jsx-a11y/media-has-caption': 'error',
|
||||
+ 'jsx-a11y/mouse-events-have-key-events': 'error',
|
||||
+ 'jsx-a11y/no-access-key': 'error',
|
||||
+ 'jsx-a11y/no-autofocus': 'error',
|
||||
+ 'jsx-a11y/no-distracting-elements': 'error',
|
||||
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ tr: ['none', 'presentation'],
|
||||
+ canvas: ['img'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/no-noninteractive-element-interactions': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ handlers: [
|
||||
+ 'onClick',
|
||||
+ 'onError',
|
||||
+ 'onLoad',
|
||||
+ 'onMouseDown',
|
||||
+ 'onMouseUp',
|
||||
+ 'onKeyPress',
|
||||
+ 'onKeyDown',
|
||||
+ 'onKeyUp',
|
||||
+ ],
|
||||
+ alert: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
||||
+ body: ['onError', 'onLoad'],
|
||||
+ dialog: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
||||
+ iframe: ['onError', 'onLoad'],
|
||||
+ img: ['onError', 'onLoad'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
||||
+ ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
||||
+ li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
|
||||
+ table: ['grid'],
|
||||
+ td: ['gridcell'],
|
||||
+ fieldset: ['radiogroup', 'presentation'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/no-noninteractive-tabindex': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ tags: [],
|
||||
+ roles: ['tabpanel'],
|
||||
+ allowExpressionValues: true,
|
||||
+ },
|
||||
],
|
||||
- parserOptions: {
|
||||
- ecmaFeatures: {
|
||||
- jsx: true,
|
||||
+ 'jsx-a11y/no-redundant-roles': 'error',
|
||||
+ 'jsx-a11y/no-static-element-interactions': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ allowExpressionValues: true,
|
||||
+ handlers: [
|
||||
+ 'onClick',
|
||||
+ 'onMouseDown',
|
||||
+ 'onMouseUp',
|
||||
+ 'onKeyPress',
|
||||
+ 'onKeyDown',
|
||||
+ 'onKeyUp',
|
||||
+ ],
|
||||
},
|
||||
+ ],
|
||||
+ 'jsx-a11y/role-has-required-aria-props': 'error',
|
||||
+ 'jsx-a11y/role-supports-aria-props': 'error',
|
||||
+ 'jsx-a11y/scope': 'error',
|
||||
+ 'jsx-a11y/tabindex-no-positive': 'error',
|
||||
+ },
|
||||
+ },
|
||||
+ strict: {
|
||||
+ plugins: ['jsx-a11y'],
|
||||
+ parserOptions: {
|
||||
+ ecmaFeatures: {
|
||||
+ jsx: true,
|
||||
},
|
||||
- rules: {
|
||||
- 'jsx-a11y/alt-text': 'error',
|
||||
- 'jsx-a11y/anchor-has-content': 'error',
|
||||
- 'jsx-a11y/anchor-is-valid': 'error',
|
||||
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
||||
- 'jsx-a11y/aria-props': 'error',
|
||||
- 'jsx-a11y/aria-proptypes': 'error',
|
||||
- 'jsx-a11y/aria-role': 'error',
|
||||
- 'jsx-a11y/aria-unsupported-elements': 'error',
|
||||
- 'jsx-a11y/autocomplete-valid': 'error',
|
||||
- 'jsx-a11y/click-events-have-key-events': 'error',
|
||||
- 'jsx-a11y/control-has-associated-label': ['off', {
|
||||
+ },
|
||||
+ rules: {
|
||||
+ 'jsx-a11y/alt-text': 'error',
|
||||
+ 'jsx-a11y/anchor-has-content': 'error',
|
||||
+ 'jsx-a11y/anchor-is-valid': 'error',
|
||||
+ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
||||
+ 'jsx-a11y/aria-props': 'error',
|
||||
+ 'jsx-a11y/aria-proptypes': 'error',
|
||||
+ 'jsx-a11y/aria-role': 'error',
|
||||
+ 'jsx-a11y/aria-unsupported-elements': 'error',
|
||||
+ 'jsx-a11y/autocomplete-valid': 'error',
|
||||
+ 'jsx-a11y/click-events-have-key-events': 'error',
|
||||
+ 'jsx-a11y/control-has-associated-label': [
|
||||
+ 'off',
|
||||
+ {
|
||||
ignoreElements: [
|
||||
'audio',
|
||||
'canvas',
|
||||
@@ -241,56 +263,63 @@ module.exports = {
|
||||
'tree',
|
||||
'treegrid',
|
||||
],
|
||||
- includeRoles: [
|
||||
- 'alert',
|
||||
- 'dialog',
|
||||
+ includeRoles: ['alert', 'dialog'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/heading-has-content': 'error',
|
||||
+ 'jsx-a11y/html-has-lang': 'error',
|
||||
+ 'jsx-a11y/iframe-has-title': 'error',
|
||||
+ 'jsx-a11y/img-redundant-alt': 'error',
|
||||
+ 'jsx-a11y/interactive-supports-focus': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ tabbable: [
|
||||
+ 'button',
|
||||
+ 'checkbox',
|
||||
+ 'link',
|
||||
+ 'progressbar',
|
||||
+ 'searchbox',
|
||||
+ 'slider',
|
||||
+ 'spinbutton',
|
||||
+ 'switch',
|
||||
+ 'textbox',
|
||||
],
|
||||
- }],
|
||||
- 'jsx-a11y/heading-has-content': 'error',
|
||||
- 'jsx-a11y/html-has-lang': 'error',
|
||||
- 'jsx-a11y/iframe-has-title': 'error',
|
||||
- 'jsx-a11y/img-redundant-alt': 'error',
|
||||
- 'jsx-a11y/interactive-supports-focus': [
|
||||
- 'error',
|
||||
- {
|
||||
- tabbable: [
|
||||
- 'button',
|
||||
- 'checkbox',
|
||||
- 'link',
|
||||
- 'progressbar',
|
||||
- 'searchbox',
|
||||
- 'slider',
|
||||
- 'spinbutton',
|
||||
- 'switch',
|
||||
- 'textbox',
|
||||
- ],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/label-has-for': 'off',
|
||||
- 'jsx-a11y/label-has-associated-control': 'error',
|
||||
- 'jsx-a11y/media-has-caption': 'error',
|
||||
- 'jsx-a11y/mouse-events-have-key-events': 'error',
|
||||
- 'jsx-a11y/no-access-key': 'error',
|
||||
- 'jsx-a11y/no-autofocus': 'error',
|
||||
- 'jsx-a11y/no-distracting-elements': 'error',
|
||||
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
||||
- 'jsx-a11y/no-noninteractive-element-interactions': [
|
||||
- 'error',
|
||||
- {
|
||||
- body: ['onError', 'onLoad'],
|
||||
- iframe: ['onError', 'onLoad'],
|
||||
- img: ['onError', 'onLoad'],
|
||||
- },
|
||||
- ],
|
||||
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
|
||||
- 'jsx-a11y/no-noninteractive-tabindex': 'error',
|
||||
- 'jsx-a11y/no-redundant-roles': 'error',
|
||||
- 'jsx-a11y/no-static-element-interactions': 'error',
|
||||
- 'jsx-a11y/role-has-required-aria-props': 'error',
|
||||
- 'jsx-a11y/role-supports-aria-props': 'error',
|
||||
- 'jsx-a11y/scope': 'error',
|
||||
- 'jsx-a11y/tabindex-no-positive': 'error',
|
||||
- },
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/label-has-for': 'off',
|
||||
+ 'jsx-a11y/label-has-associated-control': 'error',
|
||||
+ 'jsx-a11y/media-has-caption': 'error',
|
||||
+ 'jsx-a11y/mouse-events-have-key-events': 'error',
|
||||
+ 'jsx-a11y/no-access-key': 'error',
|
||||
+ 'jsx-a11y/no-autofocus': 'error',
|
||||
+ 'jsx-a11y/no-distracting-elements': 'error',
|
||||
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
||||
+ 'jsx-a11y/no-noninteractive-element-interactions': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ body: ['onError', 'onLoad'],
|
||||
+ iframe: ['onError', 'onLoad'],
|
||||
+ img: ['onError', 'onLoad'],
|
||||
+ },
|
||||
+ ],
|
||||
+ 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
|
||||
+ 'jsx-a11y/no-noninteractive-tabindex': 'error',
|
||||
+ 'jsx-a11y/no-redundant-roles': 'error',
|
||||
+ 'jsx-a11y/no-static-element-interactions': 'error',
|
||||
+ 'jsx-a11y/role-has-required-aria-props': 'error',
|
||||
+ 'jsx-a11y/role-supports-aria-props': 'error',
|
||||
+ 'jsx-a11y/scope': 'error',
|
||||
+ 'jsx-a11y/tabindex-no-positive': 'error',
|
||||
},
|
||||
},
|
||||
+ 'tabindex-no-positive': tabindexNoPositive,
|
||||
};
|
||||
+
|
||||
+/** @param {object} obj */
|
||||
+function kebabCase(obj) {
|
||||
+ return Object.fromEntries(
|
||||
+ Object.entries(obj).map(([key, value]) => [
|
||||
+ key.replace(/([A-Z])/g, '-$1').toLowerCase(),
|
||||
+ value,
|
||||
+ ]),
|
||||
+ );
|
||||
+}
|
||||
|
||||
const recommendedRules = {
|
||||
@@ -60,15 +102,7 @@ const recommendedRules = {
|
||||
'jsx-a11y/control-has-associated-label': [
|
||||
'off',
|
||||
{
|
||||
- ignoreElements: [
|
||||
- 'audio',
|
||||
- 'canvas',
|
||||
- 'embed',
|
||||
- 'input',
|
||||
- 'textarea',
|
||||
- 'tr',
|
||||
- 'video',
|
||||
- ],
|
||||
+ ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
||||
ignoreRoles: [
|
||||
'grid',
|
||||
'listbox',
|
||||
@@ -139,24 +173,8 @@ const recommendedRules = {
|
||||
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
|
||||
'error',
|
||||
{
|
||||
- ul: [
|
||||
- 'listbox',
|
||||
- 'menu',
|
||||
- 'menubar',
|
||||
- 'radiogroup',
|
||||
- 'tablist',
|
||||
- 'tree',
|
||||
- 'treegrid',
|
||||
- ],
|
||||
- ol: [
|
||||
- 'listbox',
|
||||
- 'menu',
|
||||
- 'menubar',
|
||||
- 'radiogroup',
|
||||
- 'tablist',
|
||||
- 'tree',
|
||||
- 'treegrid',
|
||||
- ],
|
||||
+ ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
||||
+ ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
||||
li: [
|
||||
'menuitem',
|
||||
'menuitemradio',
|
||||
@@ -214,15 +232,7 @@ const strictRules = {
|
||||
'jsx-a11y/control-has-associated-label': [
|
||||
'off',
|
||||
{
|
||||
- ignoreElements: [
|
||||
- 'audio',
|
||||
- 'canvas',
|
||||
- 'embed',
|
||||
- 'input',
|
||||
- 'textarea',
|
||||
- 'tr',
|
||||
- 'video',
|
||||
- ],
|
||||
+ ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
||||
ignoreRoles: [
|
||||
'grid',
|
||||
'listbox',
|
||||
@@ -299,22 +309,22 @@ const jsxA11y = {
|
||||
const createConfig = (rules, flatConfigName) => ({
|
||||
...(flatConfigName
|
||||
? {
|
||||
- ...flatConfigBase,
|
||||
- name: `jsx-a11y/${flatConfigName}`,
|
||||
- plugins: { 'jsx-a11y': jsxA11y },
|
||||
- }
|
||||
+ ...flatConfigBase,
|
||||
+ name: `jsx-a11y/${flatConfigName}`,
|
||||
+ plugins: { 'jsx-a11y': jsxA11y },
|
||||
+ }
|
||||
: { ...legacyConfigBase, plugins: ['jsx-a11y'] }),
|
||||
rules: { ...rules },
|
||||
});
|
||||
|
||||
// Create configs for the plugin object
|
||||
-const configs = {
|
||||
+export const configs = {
|
||||
recommended: createConfig(recommendedRules),
|
||||
strict: createConfig(strictRules),
|
||||
};
|
||||
-const flatConfigs = {
|
||||
+export const flatConfigs = {
|
||||
recommended: createConfig(recommendedRules, 'recommended'),
|
||||
strict: createConfig(strictRules, 'strict'),
|
||||
};
|
||||
|
||||
-module.exports = { ...jsxA11y, configs, flatConfigs };
|
||||
+export default { ...jsxA11y, configs, flatConfigs };
|
||||
diff --git a/src/util/mayContainChildComponent.js b/src/util/mayContainChildComponent.js
|
||||
index 43a03ef..5e1035e 100644
|
||||
--- a/src/util/mayContainChildComponent.js
|
||||
|
Reference in New Issue
Block a user