Skip to content

Commit ab7231d

Browse files
author
Josh Goldberg
authored
Added converter for react-a11y-props (#1142)
1 parent af24cbc commit ab7231d

File tree

4 files changed

+39
-7
lines changed

4 files changed

+39
-7
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ import { convertQuotemark } from "./ruleConverters/quotemark";
255255
import { convertRadix } from "./ruleConverters/radix";
256256
import { convertReactA11yAccessibleHeadings } from "./ruleConverters/react-a11y-accessible-headings";
257257
import { convertReactA11yAnchors } from "./ruleConverters/react-a11y-anchors";
258+
import { convertReactA11yProps } from "./ruleConverters/react-a11y-props";
258259
import { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive";
259260
import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html";
260261
import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing";
@@ -493,6 +494,7 @@ export const ruleConverters = new Map([
493494
["quotemark", convertQuotemark],
494495
["radix", convertRadix],
495496
["react-a11y-anchors", convertReactA11yAnchors],
497+
["react-a11y-props", convertReactA11yProps],
496498
["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive],
497499
["react-no-dangerous-html", convertReactNoDangerousHtml],
498500
["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 convertReactA11yProps: RuleConverter = () => {
4+
return {
5+
plugins: ["jsx-a11y"],
6+
rules: [
7+
{
8+
ruleName: "jsx-a11y/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 { convertReactA11yProps } from "../react-a11y-props";
2+
3+
describe(convertReactA11yProps, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertReactA11yProps({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
plugins: ["jsx-a11y"],
11+
rules: [
12+
{
13+
ruleName: "jsx-a11y/aria-props",
14+
},
15+
],
16+
});
17+
});
18+
});

src/input/findPackagesConfiguration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export const findPackagesConfiguration = async (
2121
return rawConfiguration instanceof Error
2222
? rawConfiguration
2323
: {
24-
dependencies: {
25-
...rawConfiguration.dependencies,
26-
},
27-
devDependencies: {
28-
...rawConfiguration.devDependencies,
29-
},
30-
};
24+
dependencies: {
25+
...rawConfiguration.dependencies,
26+
},
27+
devDependencies: {
28+
...rawConfiguration.devDependencies,
29+
},
30+
};
3131
};

0 commit comments

Comments
 (0)