diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts index ee5f175d4..588cd3572 100644 --- a/src/converters/lintConfigs/rules/ruleConverters.ts +++ b/src/converters/lintConfigs/rules/ruleConverters.ts @@ -256,6 +256,7 @@ import { convertRadix } from "./ruleConverters/radix"; import { convertReactA11yAccessibleHeadings } from "./ruleConverters/react-a11y-accessible-headings"; import { convertReactA11yAnchors } from "./ruleConverters/react-a11y-anchors"; import { convertReactA11yProps } from "./ruleConverters/react-a11y-props"; +import { convertReactA11yRoleHasRequiredAriaProps } from "./ruleConverters/react-a11y-role-has-required-aria-props"; import { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive"; import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html"; import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing"; @@ -495,6 +496,7 @@ export const ruleConverters = new Map([ ["radix", convertRadix], ["react-a11y-anchors", convertReactA11yAnchors], ["react-a11y-props", convertReactA11yProps], + ["react-a11y-role-has-required-aria-props", convertReactA11yRoleHasRequiredAriaProps], ["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive], ["react-no-dangerous-html", convertReactNoDangerousHtml], ["react-tsx-curly-spacing", convertReactTsxCurlySpacing], diff --git a/src/converters/lintConfigs/rules/ruleConverters/react-a11y-role-has-required-aria-props.ts b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-role-has-required-aria-props.ts new file mode 100644 index 000000000..e5951b83b --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-role-has-required-aria-props.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../ruleConverter"; + +export const convertReactA11yRoleHasRequiredAriaProps: RuleConverter = () => { + return { + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/role-has-required-aria-props", + }, + ], + }; +}; diff --git a/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-role-has-required-aria-props.test.ts b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-role-has-required-aria-props.test.ts new file mode 100644 index 000000000..8af470226 --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-role-has-required-aria-props.test.ts @@ -0,0 +1,18 @@ +import { convertReactA11yRoleHasRequiredAriaProps } from "../react-a11y-role-has-required-aria-props"; + +describe(convertReactA11yRoleHasRequiredAriaProps, () => { + test("conversion without arguments", () => { + const result = convertReactA11yRoleHasRequiredAriaProps({ + ruleArguments: [], + }); + + expect(result).toEqual({ + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/role-has-required-aria-props", + }, + ], + }); + }); +});