Skip to content

Commit f5e4e95

Browse files
author
Josh Goldberg
authored
Added converter for react-a11y-role-has-required-aria-props (#1140)
1 parent ec6b7c3 commit f5e4e95

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
@@ -258,6 +258,7 @@ import { convertReactA11yAnchors } from "./ruleConverters/react-a11y-anchors";
258258
import { convertReactA11yImageButtonHasAlt } from "./ruleConverters/react-a11y-image-button-has-alt";
259259
import { convertReactA11yImgHasAlt } from "./ruleConverters/react-a11y-img-has-alt";
260260
import { convertReactA11yProps } from "./ruleConverters/react-a11y-props";
261+
import { convertReactA11yRoleHasRequiredAriaProps } from "./ruleConverters/react-a11y-role-has-required-aria-props";
261262
import { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive";
262263
import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html";
263264
import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing";
@@ -499,6 +500,7 @@ export const ruleConverters = new Map([
499500
["react-a11y-image-button-has-alt", convertReactA11yImageButtonHasAlt],
500501
["react-a11y-img-has-alt", convertReactA11yImgHasAlt],
501502
["react-a11y-props", convertReactA11yProps],
503+
["react-a11y-role-has-required-aria-props", convertReactA11yRoleHasRequiredAriaProps],
502504
["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive],
503505
["react-no-dangerous-html", convertReactNoDangerousHtml],
504506
["react-tsx-curly-spacing", convertReactTsxCurlySpacing],
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 convertReactA11yRoleHasRequiredAriaProps: RuleConverter = () => {
4+
return {
5+
plugins: ["jsx-a11y"],
6+
rules: [
7+
{
8+
ruleName: "jsx-a11y/role-has-required-aria-props",
9+
},
10+
],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertReactA11yRoleHasRequiredAriaProps } from "../react-a11y-role-has-required-aria-props";
2+
3+
describe(convertReactA11yRoleHasRequiredAriaProps, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertReactA11yRoleHasRequiredAriaProps({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
plugins: ["jsx-a11y"],
11+
rules: [
12+
{
13+
ruleName: "jsx-a11y/role-has-required-aria-props",
14+
},
15+
],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)