Skip to content

Commit df34872

Browse files
bmishljharb
authored andcommittedOct 24, 2021
[Refactor] switch to export default syntax for exporting rules
1 parent ff26b82 commit df34872

36 files changed

+36
-36
lines changed
 

‎src/rules/accessible-emoji.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const errorMessage = 'Emojis should be wrapped in <span>, have role="img", and h
1616

1717
const schema = generateObjSchema();
1818

19-
module.exports = {
19+
export default {
2020
meta: {
2121
docs: {
2222
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/accessible-emoji.md',

‎src/rules/alt-text.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const ruleByElement = {
192192
},
193193
};
194194

195-
module.exports = {
195+
export default {
196196
meta: {
197197
docs: {
198198
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/alt-text.md',

‎src/rules/anchor-has-content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const errorMessage = 'Anchors must have content and the content must be accessib
1515

1616
const schema = generateObjSchema({ components: arraySchema });
1717

18-
module.exports = {
18+
export default {
1919
meta: {
2020
docs: {
2121
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/anchor-has-content.md',

‎src/rules/anchor-is-valid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const schema = generateObjSchema({
2727
aspects: enumArraySchema(allAspects, 1),
2828
});
2929

30-
module.exports = ({
30+
export default ({
3131
meta: {
3232
docs: {
3333
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/anchor-is-valid.md',

‎src/rules/aria-activedescendant-has-tabindex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const schema = generateObjSchema();
1919

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

22-
module.exports = {
22+
export default {
2323
meta: {
2424
docs: {
2525
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-activedescendant-has-tabindex.md',

‎src/rules/aria-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const errorMessage = (name) => {
2727

2828
const schema = generateObjSchema();
2929

30-
module.exports = {
30+
export default {
3131
meta: {
3232
docs: {
3333
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-props.md',

‎src/rules/aria-proptypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const validityCheck = (value, expectedType, permittedValues) => {
6262

6363
const schema = generateObjSchema();
6464

65-
module.exports = {
65+
export default {
6666
validityCheck,
6767
meta: {
6868
docs: {

‎src/rules/aria-role.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const schema = generateObjSchema({
2020
},
2121
});
2222

23-
module.exports = {
23+
export default {
2424
meta: {
2525
docs: {
2626
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-role.md',

‎src/rules/aria-unsupported-elements.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Try removing the prop '${invalidProp}'.`
2222

2323
const schema = generateObjSchema();
2424

25-
module.exports = {
25+
export default {
2626
meta: {
2727
docs: {
2828
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/aria-unsupported-elements.md',

‎src/rules/autocomplete-valid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const schema = generateObjSchema({
1414
inputComponents: arraySchema,
1515
});
1616

17-
module.exports = {
17+
export default {
1818
meta: {
1919
docs: {
2020
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/autocomplete-valid.md',

‎src/rules/click-events-have-key-events.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const errorMessage = 'Visible, non-interactive elements with click handlers must
2020
const schema = generateObjSchema();
2121
const domElements = [...dom.keys()];
2222

23-
module.exports = {
23+
export default {
2424
meta: {
2525
docs: {
2626
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/click-events-have-key-events.md',

‎src/rules/control-has-associated-label.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const schema = generateObjSchema({
3636
},
3737
});
3838

39-
module.exports = ({
39+
export default ({
4040
meta: {
4141
docs: {},
4242
schema: [schema],

‎src/rules/heading-has-content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const headings = [
2525

2626
const schema = generateObjSchema({ components: arraySchema });
2727

28-
module.exports = {
28+
export default {
2929
meta: {
3030
docs: {
3131
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/heading-has-content.md',

‎src/rules/html-has-lang.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const errorMessage = '<html> elements must have the lang prop.';
1414

1515
const schema = generateObjSchema();
1616

17-
module.exports = {
17+
export default {
1818
meta: {
1919
docs: {
2020
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/html-has-lang.md',

‎src/rules/iframe-has-title.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const errorMessage = '<iframe> elements must have a unique title property.';
1414

1515
const schema = generateObjSchema();
1616

17-
module.exports = {
17+
export default {
1818
meta: {
1919
docs: {
2020
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/iframe-has-title.md',

‎src/rules/img-redundant-alt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const schema = generateObjSchema({
2424
words: arraySchema,
2525
});
2626

27-
module.exports = {
27+
export default {
2828
meta: {
2929
docs: {
3030
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/img-redundant-alt.md',

‎src/rules/interactive-supports-focus.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const interactiveProps = [
4747
...eventHandlersByType.keyboard,
4848
];
4949

50-
module.exports = ({
50+
export default ({
5151
meta: {
5252
docs: {
5353
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/interactive-supports-focus.md',

‎src/rules/label-has-associated-control.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const validateId = (node) => {
4141
return htmlForAttr !== false && !!htmlForValue;
4242
};
4343

44-
module.exports = ({
44+
export default ({
4545
meta: {
4646
docs: {},
4747
schema: [schema],

‎src/rules/label-has-for.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const getValidityStatus = (node, required, allowChildren) => {
8484
return { isValid, message };
8585
};
8686

87-
module.exports = {
87+
export default {
8888
meta: {
8989
deprecated: true,
9090
docs: {

‎src/rules/lang.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const errorMessage = 'lang attribute must have a valid value.';
1515

1616
const schema = generateObjSchema();
1717

18-
module.exports = {
18+
export default {
1919
meta: {
2020
docs: {
2121
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/lang.md',

‎src/rules/media-has-caption.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const isTrackType = (context, type) => {
3535
return ['track'].concat(options.track || []).some((typeToCheck) => typeToCheck === type);
3636
};
3737

38-
module.exports = ({
38+
export default ({
3939
meta: {
4040
docs: {
4141
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/media-has-caption.md',

‎src/rules/mouse-events-have-key-events.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const mouseOutErrorMessage = 'onMouseOut must be accompanied by onBlur for acces
1717

1818
const schema = generateObjSchema();
1919

20-
module.exports = {
20+
export default {
2121
meta: {
2222
docs: {
2323
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/mouse-events-have-key-events.md',

‎src/rules/no-access-key.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const errorMessage = 'No access key attribute allowed. Inconsistencies between k
1414

1515
const schema = generateObjSchema();
1616

17-
module.exports = {
17+
export default {
1818
meta: {
1919
docs: {
2020
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-access-key.md',

‎src/rules/no-autofocus.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const schema = generateObjSchema({
2020
},
2121
});
2222

23-
module.exports = {
23+
export default {
2424
meta: {
2525
docs: {
2626
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-autofocus.md',

‎src/rules/no-distracting-elements.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const schema = generateObjSchema({
2323
elements: enumArraySchema(DEFAULT_ELEMENTS),
2424
});
2525

26-
module.exports = {
26+
export default {
2727
meta: {
2828
docs: {
2929
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-distracting-elements.md',

‎src/rules/no-interactive-element-to-noninteractive-role.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const errorMessage = 'Interactive elements should not be assigned non-interactiv
2929

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

32-
module.exports = ({
32+
export default ({
3333
meta: {
3434
docs: {
3535
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-interactive-element-to-noninteractive-role.md',

‎src/rules/no-noninteractive-element-interactions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const schema = generateObjSchema({
4242
handlers: arraySchema,
4343
});
4444

45-
module.exports = ({
45+
export default ({
4646
meta: {
4747
docs: {
4848
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-element-interactions.md',

‎src/rules/no-noninteractive-element-to-interactive-role.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const errorMessage = 'Non-interactive elements should not be assigned interactiv
2727

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

30-
module.exports = ({
30+
export default ({
3131
meta: {
3232
docs: {
3333
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-element-to-interactive-role.md',

‎src/rules/no-noninteractive-tabindex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const schema = generateObjSchema({
3636
},
3737
});
3838

39-
module.exports = ({
39+
export default ({
4040
meta: {
4141
docs: {
4242
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-noninteractive-tabindex.md',

‎src/rules/no-onchange.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const applicableTypes = [
1919

2020
const schema = generateObjSchema();
2121

22-
module.exports = {
22+
export default {
2323
meta: {
2424
docs: {
2525
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-onchange.md',

‎src/rules/no-redundant-roles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const errorMessage = (element, implicitRole) => (
2323

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

26-
module.exports = ({
26+
export default ({
2727
meta: {
2828
docs: {
2929
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-redundant-roles.md',

‎src/rules/no-static-element-interactions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const schema = generateObjSchema({
4141
handlers: arraySchema,
4242
});
4343

44-
module.exports = ({
44+
export default ({
4545
meta: {
4646
docs: {
4747
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/no-static-element-interactions.md',

‎src/rules/role-has-required-aria-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const errorMessage = (role, requiredProps) => (
2424

2525
const schema = generateObjSchema();
2626

27-
module.exports = {
27+
export default {
2828
meta: {
2929
docs: {
3030
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/role-has-required-aria-props.md',

‎src/rules/role-supports-aria-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This role is implicit on the element ${tag}.`;
3333

3434
const schema = generateObjSchema();
3535

36-
module.exports = {
36+
export default {
3737
meta: {
3838
docs: {
3939
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/role-supports-aria-props.md',

‎src/rules/scope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const errorMessage = 'The scope prop can only be used on <th> elements.';
1515

1616
const schema = generateObjSchema();
1717

18-
module.exports = {
18+
export default {
1919
meta: {
2020
docs: {
2121
url: 'https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules/scope.md',

‎src/rules/tabindex-no-positive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const errorMessage = 'Avoid positive integer values for tabIndex.';
1414

1515
const schema = generateObjSchema();
1616

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

0 commit comments

Comments
 (0)
Please sign in to comment.