From df34872de14efe00c382348c0af276f3bd6bd5e0 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Sun, 24 Oct 2021 16:18:08 -0400 Subject: [PATCH] [Refactor] switch to `export default` syntax for exporting rules --- src/rules/accessible-emoji.js | 2 +- src/rules/alt-text.js | 2 +- src/rules/anchor-has-content.js | 2 +- src/rules/anchor-is-valid.js | 2 +- src/rules/aria-activedescendant-has-tabindex.js | 2 +- src/rules/aria-props.js | 2 +- src/rules/aria-proptypes.js | 2 +- src/rules/aria-role.js | 2 +- src/rules/aria-unsupported-elements.js | 2 +- src/rules/autocomplete-valid.js | 2 +- src/rules/click-events-have-key-events.js | 2 +- src/rules/control-has-associated-label.js | 2 +- src/rules/heading-has-content.js | 2 +- src/rules/html-has-lang.js | 2 +- src/rules/iframe-has-title.js | 2 +- src/rules/img-redundant-alt.js | 2 +- src/rules/interactive-supports-focus.js | 2 +- src/rules/label-has-associated-control.js | 2 +- src/rules/label-has-for.js | 2 +- src/rules/lang.js | 2 +- src/rules/media-has-caption.js | 2 +- src/rules/mouse-events-have-key-events.js | 2 +- src/rules/no-access-key.js | 2 +- src/rules/no-autofocus.js | 2 +- src/rules/no-distracting-elements.js | 2 +- src/rules/no-interactive-element-to-noninteractive-role.js | 2 +- src/rules/no-noninteractive-element-interactions.js | 2 +- src/rules/no-noninteractive-element-to-interactive-role.js | 2 +- src/rules/no-noninteractive-tabindex.js | 2 +- src/rules/no-onchange.js | 2 +- src/rules/no-redundant-roles.js | 2 +- src/rules/no-static-element-interactions.js | 2 +- src/rules/role-has-required-aria-props.js | 2 +- src/rules/role-supports-aria-props.js | 2 +- src/rules/scope.js | 2 +- src/rules/tabindex-no-positive.js | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/rules/accessible-emoji.js b/src/rules/accessible-emoji.js index e74d8cce0..53f2dffe5 100644 --- a/src/rules/accessible-emoji.js +++ b/src/rules/accessible-emoji.js @@ -16,7 +16,7 @@ const errorMessage = 'Emojis should be wrapped in , have role="img", and h const schema = generateObjSchema(); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/accessible-emoji.md', diff --git a/src/rules/alt-text.js b/src/rules/alt-text.js index af60de071..aeff8ffec 100644 --- a/src/rules/alt-text.js +++ b/src/rules/alt-text.js @@ -192,7 +192,7 @@ const ruleByElement = { }, }; -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/alt-text.md', diff --git a/src/rules/anchor-has-content.js b/src/rules/anchor-has-content.js index 36b816dfd..b91dd688f 100644 --- a/src/rules/anchor-has-content.js +++ b/src/rules/anchor-has-content.js @@ -15,7 +15,7 @@ const errorMessage = 'Anchors must have content and the content must be accessib const schema = generateObjSchema({ components: arraySchema }); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/anchor-has-content.md', diff --git a/src/rules/anchor-is-valid.js b/src/rules/anchor-is-valid.js index ebcefe21a..4e6a580a5 100644 --- a/src/rules/anchor-is-valid.js +++ b/src/rules/anchor-is-valid.js @@ -27,7 +27,7 @@ const schema = generateObjSchema({ aspects: enumArraySchema(allAspects, 1), }); -module.exports = ({ +export default ({ meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/anchor-is-valid.md', diff --git a/src/rules/aria-activedescendant-has-tabindex.js b/src/rules/aria-activedescendant-has-tabindex.js index 50e66f666..d05f1d3b8 100644 --- a/src/rules/aria-activedescendant-has-tabindex.js +++ b/src/rules/aria-activedescendant-has-tabindex.js @@ -19,7 +19,7 @@ const schema = generateObjSchema(); const domElements = [...dom.keys()]; -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-activedescendant-has-tabindex.md', diff --git a/src/rules/aria-props.js b/src/rules/aria-props.js index f4e4e1429..0cc0c2126 100644 --- a/src/rules/aria-props.js +++ b/src/rules/aria-props.js @@ -27,7 +27,7 @@ const errorMessage = (name) => { const schema = generateObjSchema(); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-props.md', diff --git a/src/rules/aria-proptypes.js b/src/rules/aria-proptypes.js index 6849d4695..00e50f5e6 100644 --- a/src/rules/aria-proptypes.js +++ b/src/rules/aria-proptypes.js @@ -62,7 +62,7 @@ const validityCheck = (value, expectedType, permittedValues) => { const schema = generateObjSchema(); -module.exports = { +export default { validityCheck, meta: { docs: { diff --git a/src/rules/aria-role.js b/src/rules/aria-role.js index 57ad86f25..11cd023df 100644 --- a/src/rules/aria-role.js +++ b/src/rules/aria-role.js @@ -20,7 +20,7 @@ const schema = generateObjSchema({ }, }); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-role.md', diff --git a/src/rules/aria-unsupported-elements.js b/src/rules/aria-unsupported-elements.js index 8fd4d7897..677dd0b41 100644 --- a/src/rules/aria-unsupported-elements.js +++ b/src/rules/aria-unsupported-elements.js @@ -22,7 +22,7 @@ Try removing the prop '${invalidProp}'.` const schema = generateObjSchema(); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-unsupported-elements.md', diff --git a/src/rules/autocomplete-valid.js b/src/rules/autocomplete-valid.js index a1c1e1c7c..1acd1e271 100644 --- a/src/rules/autocomplete-valid.js +++ b/src/rules/autocomplete-valid.js @@ -14,7 +14,7 @@ const schema = generateObjSchema({ inputComponents: arraySchema, }); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/autocomplete-valid.md', diff --git a/src/rules/click-events-have-key-events.js b/src/rules/click-events-have-key-events.js index 634c6190c..363f975e0 100644 --- a/src/rules/click-events-have-key-events.js +++ b/src/rules/click-events-have-key-events.js @@ -20,7 +20,7 @@ const errorMessage = 'Visible, non-interactive elements with click handlers must const schema = generateObjSchema(); const domElements = [...dom.keys()]; -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/click-events-have-key-events.md', diff --git a/src/rules/control-has-associated-label.js b/src/rules/control-has-associated-label.js index 411799b60..36cb2bf23 100644 --- a/src/rules/control-has-associated-label.js +++ b/src/rules/control-has-associated-label.js @@ -36,7 +36,7 @@ const schema = generateObjSchema({ }, }); -module.exports = ({ +export default ({ meta: { docs: {}, schema: [schema], diff --git a/src/rules/heading-has-content.js b/src/rules/heading-has-content.js index 1f3f8a6d5..505817cc5 100644 --- a/src/rules/heading-has-content.js +++ b/src/rules/heading-has-content.js @@ -25,7 +25,7 @@ const headings = [ const schema = generateObjSchema({ components: arraySchema }); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/heading-has-content.md', diff --git a/src/rules/html-has-lang.js b/src/rules/html-has-lang.js index 7189cdda2..e2a8169be 100644 --- a/src/rules/html-has-lang.js +++ b/src/rules/html-has-lang.js @@ -14,7 +14,7 @@ const errorMessage = ' elements must have the lang prop.'; const schema = generateObjSchema(); -module.exports = { +export default { meta: { docs: { url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/html-has-lang.md', diff --git a/src/rules/iframe-has-title.js b/src/rules/iframe-has-title.js index fa77e0010..1122773a2 100644 --- a/src/rules/iframe-has-title.js +++ b/src/rules/iframe-has-title.js @@ -14,7 +14,7 @@ const errorMessage = '