Skip to content

Commit 2c57373

Browse files
author
Josh Goldberg
authored
Added converter for react-a11y-role-supports-aria-props (#1137)
1 parent ab9a794 commit 2c57373

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
@@ -263,6 +263,7 @@ import { convertReactA11yLang } from "./ruleConverters/react-a11y-lang";
263263
import { convertReactA11yProps } from "./ruleConverters/react-a11y-props";
264264
import { convertReactA11yRole } from "./ruleConverters/react-a11y-role";
265265
import { convertReactA11yRoleHasRequiredAriaProps } from "./ruleConverters/react-a11y-role-has-required-aria-props";
266+
import { convertReactA11yRoleSupportsAriaProps } from "./ruleConverters/react-a11y-role-supports-aria-props";
266267
import { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive";
267268
import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html";
268269
import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing";
@@ -508,6 +509,7 @@ export const ruleConverters = new Map([
508509
["react-a11y-lang", convertReactA11yLang],
509510
["react-a11y-props", convertReactA11yProps],
510511
["react-a11y-role-has-required-aria-props", convertReactA11yRoleHasRequiredAriaProps],
512+
["react-a11y-role-supports-aria-props", convertReactA11yRoleSupportsAriaProps],
511513
["react-a11y-role", convertReactA11yRole],
512514
["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive],
513515
["react-no-dangerous-html", convertReactNoDangerousHtml],
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 convertReactA11yRoleSupportsAriaProps: RuleConverter = () => {
4+
return {
5+
plugins: ["jsx-a11y"],
6+
rules: [
7+
{
8+
ruleName: "jsx-a11y/role-supports-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 { convertReactA11yRoleSupportsAriaProps } from "../react-a11y-role-supports-aria-props";
2+
3+
describe(convertReactA11yRoleSupportsAriaProps, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertReactA11yRoleSupportsAriaProps({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
plugins: ["jsx-a11y"],
11+
rules: [
12+
{
13+
ruleName: "jsx-a11y/role-supports-aria-props",
14+
},
15+
],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)