Skip to content

Commit c2b693f

Browse files
KingDarBojaJosh Goldberg
authored andcommitted
Add deprecation converter (#253)
1 parent 4494aa8 commit c2b693f

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

src/rules/converters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { convertClassName } from "./converters/class-name";
1313
import { convertCommentFormat } from "./converters/comment-format";
1414
import { convertCurly } from "./converters/curly";
1515
import { convertCyclomaticComplexity } from "./converters/cyclomatic-complexity";
16+
import { convertDeprecation } from "./converters/deprecation";
1617
import { convertEofline } from "./converters/eofline";
1718
import { convertFileNameCasing } from "./converters/file-name-casing";
1819
import { convertForin } from "./converters/forin";
@@ -147,6 +148,7 @@ export const converters = new Map([
147148
["comment-format", convertCommentFormat],
148149
["curly", convertCurly],
149150
["cyclomatic-complexity", convertCyclomaticComplexity],
151+
["deprecation", convertDeprecation],
150152
["eofline", convertEofline],
151153
["file-name-casing", convertFileNameCasing],
152154
["forin", convertForin],

src/rules/converters/deprecation.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleConverter } from "../converter";
2+
3+
export const convertDeprecation: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "import/no-deprecated",
8+
},
9+
],
10+
plugins: ["eslint-plugin-import"],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertDeprecation } from "../deprecation";
2+
3+
describe(convertDeprecation, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertDeprecation({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "import/no-deprecated",
13+
},
14+
],
15+
plugins: ["eslint-plugin-import"],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)