Skip to content

Commit af24cbc

Browse files
author
Josh Goldberg
authored
Added converter for react-a11y-tabindex-no-positive (#1134)
1 parent f6e77ad commit af24cbc

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
@@ -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 { convertReactA11yTabIndexNoPositive } from "./ruleConverters/react-a11y-tabindex-no-positive";
258259
import { convertReactNoDangerousHtml } from "./ruleConverters/react-no-dangerous-html";
259260
import { convertReactTsxCurlySpacing } from "./ruleConverters/react-tsx-curly-spacing";
260261
import { convertRestrictPlusOperands } from "./ruleConverters/restrict-plus-operands";
@@ -492,6 +493,7 @@ export const ruleConverters = new Map([
492493
["quotemark", convertQuotemark],
493494
["radix", convertRadix],
494495
["react-a11y-anchors", convertReactA11yAnchors],
496+
["react-a11y-tabindex-no-positive", convertReactA11yTabIndexNoPositive],
495497
["react-no-dangerous-html", convertReactNoDangerousHtml],
496498
["react-tsx-curly-spacing", convertReactTsxCurlySpacing],
497499
["relative-url-prefix", convertRelativeUrlPrefix],
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 convertReactA11yTabIndexNoPositive: RuleConverter = () => {
4+
return {
5+
plugins: ["jsx-a11y"],
6+
rules: [
7+
{
8+
ruleName: "jsx-a11y/tabindex-no-positive",
9+
},
10+
],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertReactA11yTabIndexNoPositive } from "../react-a11y-tabindex-no-positive";
2+
3+
describe(convertReactA11yTabIndexNoPositive, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertReactA11yTabIndexNoPositive({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
plugins: ["jsx-a11y"],
11+
rules: [
12+
{
13+
ruleName: "jsx-a11y/tabindex-no-positive",
14+
},
15+
],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)