diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts index eb3914515..ee5f175d4 100644 --- a/src/converters/lintConfigs/rules/ruleConverters.ts +++ b/src/converters/lintConfigs/rules/ruleConverters.ts @@ -255,6 +255,7 @@ import { convertQuotemark } from "./ruleConverters/quotemark"; 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 { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive"; import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html"; import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing"; @@ -493,6 +494,7 @@ export const ruleConverters = new Map([ ["quotemark", convertQuotemark], ["radix", convertRadix], ["react-a11y-anchors", convertReactA11yAnchors], + ["react-a11y-props", convertReactA11yProps], ["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-props.ts b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-props.ts new file mode 100644 index 000000000..fdf94a961 --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/react-a11y-props.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../ruleConverter"; + +export const convertReactA11yProps: RuleConverter = () => { + return { + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/aria-props", + }, + ], + }; +}; diff --git a/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-props.test.ts b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-props.test.ts new file mode 100644 index 000000000..673772fc3 --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/tests/react-a11y-props.test.ts @@ -0,0 +1,18 @@ +import { convertReactA11yProps } from "../react-a11y-props"; + +describe(convertReactA11yProps, () => { + test("conversion without arguments", () => { + const result = convertReactA11yProps({ + ruleArguments: [], + }); + + expect(result).toEqual({ + plugins: ["jsx-a11y"], + rules: [ + { + ruleName: "jsx-a11y/aria-props", + }, + ], + }); + }); +}); diff --git a/src/input/findPackagesConfiguration.ts b/src/input/findPackagesConfiguration.ts index 900acc0da..5e614e0d2 100644 --- a/src/input/findPackagesConfiguration.ts +++ b/src/input/findPackagesConfiguration.ts @@ -21,11 +21,11 @@ export const findPackagesConfiguration = async ( return rawConfiguration instanceof Error ? rawConfiguration : { - dependencies: { - ...rawConfiguration.dependencies, - }, - devDependencies: { - ...rawConfiguration.devDependencies, - }, - }; + dependencies: { + ...rawConfiguration.dependencies, + }, + devDependencies: { + ...rawConfiguration.devDependencies, + }, + }; };