Skip to content

Commit ecf97e7

Browse files
aspondaJosh Goldberg
authored and
Josh Goldberg
committed
Added no-async-without-await converter and unit tests (#206)
* feat: added no-async-without-await converter and unit tests * fix: no-async-without-await converter to @typescript-eslint/require-await
1 parent d17fb1b commit ecf97e7

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
@@ -31,6 +31,7 @@ import { convertNewlinePerChainedCall } from "./converters/newline-per-chained-c
3131
import { convertNewParens } from "./converters/new-parens";
3232
import { convertNoAngleBracketTypeAssertion } from "./converters/no-angle-bracket-type-assertion";
3333
import { convertNoArg } from "./converters/no-arg";
34+
import { convertNoAsyncWithoutAwait } from "./converters/no-async-without-await";
3435
import { convertNoBannedTerms } from "./converters/no-banned-terms";
3536
import { convertNoBitwise } from "./converters/no-bitwise";
3637
import { convertNoConditionalAssignment } from "./converters/no-conditional-assignment";
@@ -154,6 +155,7 @@ export const converters = new Map([
154155
["no-angle-bracket-type-assertion", convertNoAngleBracketTypeAssertion],
155156
["no-any", convertNoExplicitAny],
156157
["no-arg", convertNoArg],
158+
["no-async-without-await", convertNoAsyncWithoutAwait],
157159
["no-banned-terms", convertNoBannedTerms],
158160
["no-bitwise", convertNoBitwise],
159161
["no-conditional-assignment", convertNoConditionalAssignment],
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 convertNoAsyncWithoutAwait: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "@typescript-eslint/require-await",
8+
},
9+
],
10+
};
11+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { convertNoAsyncWithoutAwait } from "../no-async-without-await";
2+
3+
describe(convertNoAsyncWithoutAwait, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoAsyncWithoutAwait({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "@typescript-eslint/require-await",
13+
},
14+
],
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)