diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts index 6aa26018e..0feef33c9 100644 --- a/src/converters/lintConfigs/rules/ruleConverters.ts +++ b/src/converters/lintConfigs/rules/ruleConverters.ts @@ -257,6 +257,7 @@ import { convertReactA11yAccessibleHeadings } from "./ruleConverters/react-a11y- import { convertReactA11yAnchors } from "./ruleConverters/react-a11y-anchors"; import { convertReactA11yImageButtonHasAlt } from "./ruleConverters/react-a11y-image-button-has-alt"; import { convertReactA11yImgHasAlt } from "./ruleConverters/react-a11y-img-has-alt"; +import { convertReactA11yLang } from "./ruleConverters/react-a11y-lang"; 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"; @@ -499,6 +500,7 @@ export const ruleConverters = new Map([ ["react-a11y-anchors", convertReactA11yAnchors], ["react-a11y-image-button-has-alt", convertReactA11yImageButtonHasAlt], ["react-a11y-img-has-alt", convertReactA11yImgHasAlt], + ["react-a11y-lang", convertReactA11yLang], ["react-a11y-props", convertReactA11yProps], ["react-a11y-role-has-required-aria-props", convertReactA11yRoleHasRequiredAriaProps], ["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive], diff --git a/src/converters/lintConfigs/rules/ruleConverters/react-a11y-lang.ts b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-lang.ts new file mode 100644 index 000000000..04a651030 --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-lang.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../ruleConverter"; + +export const convertReactA11yLang: RuleConverter = () => { + return { + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/lang", + }, + ], + }; +}; diff --git a/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-lang.test.ts b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-lang.test.ts new file mode 100644 index 000000000..c66211388 --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-lang.test.ts @@ -0,0 +1,18 @@ +import { convertReactA11yLang } from "../react-a11y-lang"; + +describe(convertReactA11yLang, () => { + test("conversion without arguments", () => { + const result = convertReactA11yLang({ + ruleArguments: [], + }); + + expect(result).toEqual({ + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/lang", + }, + ], + }); + }); +});