Skip to content

Commit 53954a5

Browse files
author
Josh Goldberg
committed
Added converter for react-a11y-event-has-role
1 parent 1fc8e03 commit 53954a5

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ import { convertQuotemark } from "./ruleConverters/quotemark";
253253
import { convertRadix } from "./ruleConverters/radix";
254254
import { convertReactA11yAccessibleHeadings } from "./ruleConverters/react-a11y-accessible-headings";
255255
import { convertReactA11yAnchors } from "./ruleConverters/react-a11y-anchors";
256+
import { convertReactA11yEventHasRole } from "./ruleConverters/react-a11y-event-has-role";
256257
import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html";
257258
import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing";
258259
import { convertRestrictPlusOperands } from "./ruleConverters/restrict-plus-operands";
@@ -488,6 +489,7 @@ export const ruleConverters = new Map([
488489
["quotemark", convertQuotemark],
489490
["radix", convertRadix],
490491
["react-a11y-anchors", convertReactA11yAnchors],
492+
["react-a11y-event-has-role", convertReactA11yEventHasRole],
491493
["react-no-dangerous-html", convertReactNoDangerousHtml],
492494
["react-tsx-curly-spacing", convertReactTsxCurlySpacing],
493495
["relative-url-prefix", convertRelativeUrlPrefix],
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleConverter } from "../ruleConverter";
2+
3+
export const convertReactA11yEventHasRole: RuleConverter = () => {
4+
return {
5+
plugins: ["jsx-a11y"],
6+
rules: [
7+
{
8+
ruleName: "jsx-a11y/alt-text",
9+
},
10+
],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertReactA11yEventHasRole } from "../react-a11y-event-has-role";
2+
3+
describe(convertReactA11yEventHasRole, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertReactA11yEventHasRole({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
plugins: ["jsx-a11y"],
11+
rules: [
12+
{
13+
ruleName: "jsx-a11y/alt-text",
14+
},
15+
],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)