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

Switch to export default syntax for exporting rules #819

Merged
merged 1 commit into from Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rules/accessible-emoji.js
Expand Up @@ -16,7 +16,7 @@ const errorMessage = 'Emojis should be wrapped in <span>, 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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/alt-text.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/anchor-has-content.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/anchor-is-valid.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/aria-activedescendant-has-tabindex.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/aria-props.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/aria-proptypes.js
Expand Up @@ -62,7 +62,7 @@ const validityCheck = (value, expectedType, permittedValues) => {

const schema = generateObjSchema();

module.exports = {
export default {
validityCheck,
meta: {
docs: {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/aria-role.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/aria-unsupported-elements.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/autocomplete-valid.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/click-events-have-key-events.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/control-has-associated-label.js
Expand Up @@ -36,7 +36,7 @@ const schema = generateObjSchema({
},
});

module.exports = ({
export default ({
meta: {
docs: {},
schema: [schema],
Expand Down
2 changes: 1 addition & 1 deletion src/rules/heading-has-content.js
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/html-has-lang.js
Expand Up @@ -14,7 +14,7 @@ const errorMessage = '<html> 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',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/iframe-has-title.js
Expand Up @@ -14,7 +14,7 @@ const errorMessage = '<iframe> elements must have a unique title property.';

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/iframe-has-title.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/img-redundant-alt.js
Expand Up @@ -24,7 +24,7 @@ const schema = generateObjSchema({
words: arraySchema,
});

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/img-redundant-alt.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/interactive-supports-focus.js
Expand Up @@ -47,7 +47,7 @@ const interactiveProps = [
...eventHandlersByType.keyboard,
];

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/interactive-supports-focus.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/label-has-associated-control.js
Expand Up @@ -41,7 +41,7 @@ const validateId = (node) => {
return htmlForAttr !== false && !!htmlForValue;
};

module.exports = ({
export default ({
meta: {
docs: {},
schema: [schema],
Expand Down
2 changes: 1 addition & 1 deletion src/rules/label-has-for.js
Expand Up @@ -84,7 +84,7 @@ const getValidityStatus = (node, required, allowChildren) => {
return { isValid, message };
};

module.exports = {
export default {
meta: {
deprecated: true,
docs: {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/lang.js
Expand Up @@ -15,7 +15,7 @@ const errorMessage = 'lang attribute must have a valid value.';

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/lang.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/media-has-caption.js
Expand Up @@ -35,7 +35,7 @@ const isTrackType = (context, type) => {
return ['track'].concat(options.track || []).some((typeToCheck) => typeToCheck === type);
};

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/media-has-caption.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/mouse-events-have-key-events.js
Expand Up @@ -17,7 +17,7 @@ const mouseOutErrorMessage = 'onMouseOut must be accompanied by onBlur for acces

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/mouse-events-have-key-events.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-access-key.js
Expand Up @@ -14,7 +14,7 @@ const errorMessage = 'No access key attribute allowed. Inconsistencies between k

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-access-key.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-autofocus.js
Expand Up @@ -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/no-autofocus.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-distracting-elements.js
Expand Up @@ -23,7 +23,7 @@ const schema = generateObjSchema({
elements: enumArraySchema(DEFAULT_ELEMENTS),
});

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-distracting-elements.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-interactive-element-to-noninteractive-role.js
Expand Up @@ -29,7 +29,7 @@ const errorMessage = 'Interactive elements should not be assigned non-interactiv

const domElements = [...dom.keys()];

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-interactive-element-to-noninteractive-role.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-noninteractive-element-interactions.js
Expand Up @@ -42,7 +42,7 @@ const schema = generateObjSchema({
handlers: arraySchema,
});

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-element-interactions.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-noninteractive-element-to-interactive-role.js
Expand Up @@ -27,7 +27,7 @@ const errorMessage = 'Non-interactive elements should not be assigned interactiv

const domElements = [...dom.keys()];

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-element-to-interactive-role.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-noninteractive-tabindex.js
Expand Up @@ -36,7 +36,7 @@ const schema = generateObjSchema({
},
});

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-tabindex.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-onchange.js
Expand Up @@ -19,7 +19,7 @@ const applicableTypes = [

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-onchange.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-redundant-roles.js
Expand Up @@ -23,7 +23,7 @@ const errorMessage = (element, implicitRole) => (

const DEFAULT_ROLE_EXCEPTIONS = { nav: ['navigation'] };

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-redundant-roles.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-static-element-interactions.js
Expand Up @@ -41,7 +41,7 @@ const schema = generateObjSchema({
handlers: arraySchema,
});

module.exports = ({
export default ({
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-static-element-interactions.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/role-has-required-aria-props.js
Expand Up @@ -24,7 +24,7 @@ const errorMessage = (role, requiredProps) => (

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/role-has-required-aria-props.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/role-supports-aria-props.js
Expand Up @@ -33,7 +33,7 @@ This role is implicit on the element ${tag}.`;

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/role-supports-aria-props.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/scope.js
Expand Up @@ -15,7 +15,7 @@ const errorMessage = 'The scope prop can only be used on <th> elements.';

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/scope.md',
Expand Down
2 changes: 1 addition & 1 deletion src/rules/tabindex-no-positive.js
Expand Up @@ -14,7 +14,7 @@ const errorMessage = 'Avoid positive integer values for tabIndex.';

const schema = generateObjSchema();

module.exports = {
export default {
meta: {
docs: {
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/tabindex-no-positive.md',
Expand Down