Update
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
diff --git a/src/index.js b/src/index.js
|
||||
index 7b931fe..f7c1f91 100644
|
||||
index 7b931fe..eaea267 100644
|
||||
--- a/src/index.js
|
||||
+++ b/src/index.js
|
||||
@@ -1,47 +1,87 @@
|
||||
@@ -1,296 +1,344 @@
|
||||
/* eslint-disable global-require */
|
||||
+// @ts-check
|
||||
+import accessibleEmoji from './rules/accessible-emoji';
|
||||
@ -45,7 +45,7 @@ index 7b931fe..f7c1f91 100644
|
||||
+import scope from './rules/scope';
|
||||
+import tabindexNoPositive from './rules/tabindex-no-positive';
|
||||
|
||||
module.exports = {
|
||||
-module.exports = {
|
||||
- rules: {
|
||||
- 'accessible-emoji': require('./rules/accessible-emoji'),
|
||||
- 'alt-text': require('./rules/alt-text'),
|
||||
@ -87,58 +87,532 @@ index 7b931fe..f7c1f91 100644
|
||||
- scope: require('./rules/scope'),
|
||||
- 'tabindex-no-positive': require('./rules/tabindex-no-positive'),
|
||||
- },
|
||||
+ rules: kebabCase({
|
||||
+ accessibleEmoji,
|
||||
+ altText,
|
||||
+ anchorAmbiguousText,
|
||||
+ anchorHasContent,
|
||||
+ anchorIsValid,
|
||||
+ ariaActivedescendantHasTabindex,
|
||||
+ ariaProps,
|
||||
+ ariaProptypes,
|
||||
+ ariaRole,
|
||||
+ ariaUnsupportedElements,
|
||||
+ autocompleteValid,
|
||||
+ clickEventsHaveKeyEvents,
|
||||
+ controlHasAssociatedLabel,
|
||||
+ headingHasContent,
|
||||
+ htmlHasLang,
|
||||
+ iframeHasTitle,
|
||||
+ imgRedundantAlt,
|
||||
+ interactiveSupportsFocus,
|
||||
+ labelHasAssociatedControl,
|
||||
+ labelHasFor,
|
||||
+ lang,
|
||||
+ mediaHasCaption,
|
||||
+ mouseEventsHaveKeyEvents,
|
||||
+ noAccessKey,
|
||||
+ noAriaHiddenOnFocusable,
|
||||
+ noAutofocus,
|
||||
+ noDistractingElements,
|
||||
+ noInteractiveElementToNoninteractiveRole,
|
||||
+ noNoninteractiveElementInteractions,
|
||||
+ noNoninteractiveElementToInteractiveRole,
|
||||
+ noNoninteractiveTabindex,
|
||||
+ noOnChange,
|
||||
+ noRedundantRoles,
|
||||
+ noStaticElementInteractions,
|
||||
+ preferTagOverRole,
|
||||
+ roleHasRequiredAriaProps,
|
||||
+ roleSupportsAriaProps,
|
||||
+ scope,
|
||||
+ tabindexNoPositive,
|
||||
+ }),
|
||||
configs: {
|
||||
recommended: {
|
||||
plugins: [
|
||||
@@ -294,3 +334,9 @@ module.exports = {
|
||||
- configs: {
|
||||
- recommended: {
|
||||
- plugins: [
|
||||
- 'jsx-a11y',
|
||||
+export const rules = kebabCase({
|
||||
+ accessibleEmoji,
|
||||
+ altText,
|
||||
+ anchorAmbiguousText,
|
||||
+ anchorHasContent,
|
||||
+ anchorIsValid,
|
||||
+ ariaActivedescendantHasTabindex,
|
||||
+ ariaProps,
|
||||
+ ariaProptypes,
|
||||
+ ariaRole,
|
||||
+ ariaUnsupportedElements,
|
||||
+ autocompleteValid,
|
||||
+ clickEventsHaveKeyEvents,
|
||||
+ controlHasAssociatedLabel,
|
||||
+ headingHasContent,
|
||||
+ htmlHasLang,
|
||||
+ iframeHasTitle,
|
||||
+ imgRedundantAlt,
|
||||
+ interactiveSupportsFocus,
|
||||
+ labelHasAssociatedControl,
|
||||
+ labelHasFor,
|
||||
+ lang,
|
||||
+ mediaHasCaption,
|
||||
+ mouseEventsHaveKeyEvents,
|
||||
+ noAccessKey,
|
||||
+ noAriaHiddenOnFocusable,
|
||||
+ noAutofocus,
|
||||
+ noDistractingElements,
|
||||
+ noInteractiveElementToNoninteractiveRole,
|
||||
+ noNoninteractiveElementInteractions,
|
||||
+ noNoninteractiveElementToInteractiveRole,
|
||||
+ noNoninteractiveTabindex,
|
||||
+ noOnChange,
|
||||
+ noRedundantRoles,
|
||||
+ noStaticElementInteractions,
|
||||
+ preferTagOverRole,
|
||||
+ roleHasRequiredAriaProps,
|
||||
+ 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', {
|
||||
+ ignoreElements: [
|
||||
+ 'audio',
|
||||
+ 'canvas',
|
||||
+ 'embed',
|
||||
+ 'input',
|
||||
+ 'textarea',
|
||||
+ 'tr',
|
||||
+ 'video',
|
||||
+ ],
|
||||
+ ignoreRoles: [
|
||||
+ 'grid',
|
||||
+ 'listbox',
|
||||
+ 'menu',
|
||||
+ 'menubar',
|
||||
+ 'radiogroup',
|
||||
+ 'row',
|
||||
+ 'tablist',
|
||||
+ 'toolbar',
|
||||
+ 'tree',
|
||||
+ 'treegrid',
|
||||
+ ],
|
||||
+ 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',
|
||||
+ ],
|
||||
+ },
|
||||
],
|
||||
- parserOptions: {
|
||||
- ecmaFeatures: {
|
||||
- jsx: true,
|
||||
+ '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'],
|
||||
},
|
||||
- },
|
||||
- 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',
|
||||
- 'embed',
|
||||
- 'input',
|
||||
- 'textarea',
|
||||
- 'tr',
|
||||
- 'video',
|
||||
+ ],
|
||||
+ 'jsx-a11y/no-noninteractive-element-interactions': [
|
||||
+ 'error',
|
||||
+ {
|
||||
+ handlers: [
|
||||
+ 'onClick',
|
||||
+ 'onError',
|
||||
+ 'onLoad',
|
||||
+ 'onMouseDown',
|
||||
+ 'onMouseUp',
|
||||
+ 'onKeyPress',
|
||||
+ 'onKeyDown',
|
||||
+ 'onKeyUp',
|
||||
],
|
||||
- ignoreRoles: [
|
||||
- 'grid',
|
||||
+ 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',
|
||||
- 'row',
|
||||
'tablist',
|
||||
- 'toolbar',
|
||||
'tree',
|
||||
'treegrid',
|
||||
],
|
||||
- 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/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,
|
||||
- },
|
||||
- ],
|
||||
- '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', {
|
||||
- ignoreElements: [
|
||||
- 'audio',
|
||||
- 'canvas',
|
||||
- 'embed',
|
||||
- 'input',
|
||||
- 'textarea',
|
||||
- 'tr',
|
||||
- 'video',
|
||||
- ],
|
||||
- ignoreRoles: [
|
||||
- 'grid',
|
||||
+ ol: [
|
||||
'listbox',
|
||||
'menu',
|
||||
'menubar',
|
||||
'radiogroup',
|
||||
- 'row',
|
||||
'tablist',
|
||||
- 'toolbar',
|
||||
'tree',
|
||||
'treegrid',
|
||||
],
|
||||
- includeRoles: [
|
||||
- 'alert',
|
||||
- 'dialog',
|
||||
+ li: ['menuitem', '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/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/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', {
|
||||
+ ignoreElements: [
|
||||
+ 'audio',
|
||||
+ 'canvas',
|
||||
+ 'embed',
|
||||
+ 'input',
|
||||
+ 'textarea',
|
||||
+ 'tr',
|
||||
+ 'video',
|
||||
],
|
||||
- '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'],
|
||||
- },
|
||||
+ ignoreRoles: [
|
||||
+ 'grid',
|
||||
+ 'listbox',
|
||||
+ 'menu',
|
||||
+ 'menubar',
|
||||
+ 'radiogroup',
|
||||
+ 'row',
|
||||
+ 'tablist',
|
||||
+ 'toolbar',
|
||||
+ 'tree',
|
||||
+ 'treegrid',
|
||||
],
|
||||
- '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',
|
||||
- },
|
||||
+ 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/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',
|
||||
},
|
||||
},
|
||||
};
|
||||
+
|
||||
+/** @param {object} obj */
|
||||
+function kebabCase(obj) {
|
||||
+ return Object.fromEntries(
|
||||
+ Object.entries(obj).map(([key, value]) => [key.replace(/([A-Z])/g, '-$1').toLowerCase(), value])
|
||||
+ )
|
||||
+ Object.entries(obj).map(([key, value]) => [
|
||||
+ key.replace(/([A-Z])/g, '-$1').toLowerCase(),
|
||||
+ value,
|
||||
+ ]),
|
||||
+ );
|
||||
+}
|
||||
\ No newline at end of file
|
||||
|
Reference in New Issue
Block a user