Skip to content

Commit

Permalink
chore: switch to export default syntax for exporting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Oct 24, 2021
1 parent 0021489 commit 4b7ddf3
Show file tree
Hide file tree
Showing 37 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion scripts/boilerplate/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const errorMessage = '';
const schema = generateObjSchema();
module.exports = {
export default {
meta: {
docs: {},
schema: [schema],
Expand Down
2 changes: 1 addition & 1 deletion src/rules/accessible-emoji.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 4b7ddf3

Please sign in to comment.