Skip to content

Commit c77f1b1

Browse files
author
Josh Goldberg
authored
Added missing no-floating-promises converter (#189)
1 parent b2f14c1 commit c77f1b1

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/rules/converters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { convertNoEmpty } from "./converters/no-empty";
4343
import { convertNoEmptyInterface } from "./converters/no-empty-interface";
4444
import { convertNoEval } from "./converters/no-eval";
4545
import { convertNoExplicitAny } from "./converters/no-explicit-any";
46+
import { convertNoFloatingPromises } from "./converters/no-floating-promises";
4647
import { convertNoForInArray } from "./converters/no-for-in-array";
4748
import { convertNoInferrableTypes } from "./converters/no-inferrable-types";
4849
import { convertNoInternalModule } from "./converters/no-internal-module";
@@ -135,6 +136,7 @@ export const converters = new Map([
135136
["no-duplicate-switch-case", convertNoDuplicateSwitchCase],
136137
["no-empty-interface", convertNoEmptyInterface],
137138
["no-eval", convertNoEval],
139+
["no-floating-promises", convertNoFloatingPromises],
138140
["no-for-in-array", convertNoForInArray],
139141
["no-inferrable-types", convertNoInferrableTypes],
140142
["no-internal-module", convertNoInternalModule],
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 convertNoFloatingPromises: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "@typescript-eslint/no-floating-promises",
8+
},
9+
],
10+
};
11+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { convertNoFloatingPromises } from "../no-floating-promises";
2+
3+
describe(convertNoFloatingPromises, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoFloatingPromises({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "@typescript-eslint/no-floating-promises",
13+
},
14+
],
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)