Skip to content

Commit 18ffe46

Browse files
authored
Add no-boolean-literal-compare converter (#337)
1 parent 2d9c7f5 commit 18ffe46

File tree

3 files changed

+30
-0
lines changed

3 files changed

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

src/rules/rulesConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { convertNoArg } from "./converters/no-arg";
3838
import { convertNoAsyncWithoutAwait } from "./converters/no-async-without-await";
3939
import { convertNoBannedTerms } from "./converters/no-banned-terms";
4040
import { convertNoBitwise } from "./converters/no-bitwise";
41+
import { convertNoBooleanLiteralCompare } from "./converters/no-boolean-literal-compare";
4142
import { convertNoConditionalAssignment } from "./converters/no-conditional-assignment";
4243
import { convertNoConsecutiveBlankLines } from "./converters/no-consecutive-blank-lines";
4344
import { convertNoConsole } from "./converters/no-console";
@@ -177,6 +178,7 @@ export const rulesConverters = new Map([
177178
["no-async-without-await", convertNoAsyncWithoutAwait],
178179
["no-banned-terms", convertNoBannedTerms],
179180
["no-bitwise", convertNoBitwise],
181+
["no-boolean-literal-compare", convertNoBooleanLiteralCompare],
180182
["no-conditional-assignment", convertNoConditionalAssignment],
181183
["no-consecutive-blank-lines", convertNoConsecutiveBlankLines],
182184
["no-console", convertNoConsole],

0 commit comments

Comments
 (0)