Skip to content

Commit 2c88ecd

Browse files
committed
feat: added no-async-without-await converter and unit tests
1 parent 9cc263f commit 2c88ecd

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
@@ -29,6 +29,7 @@ import { convertNewlinePerChainedCall } from "./converters/newline-per-chained-c
2929
import { convertNewParens } from "./converters/new-parens";
3030
import { convertNoAngleBracketTypeAssertion } from "./converters/no-angle-bracket-type-assertion";
3131
import { convertNoArg } from "./converters/no-arg";
32+
import { convertNoAsyncWithoutAwait } from "./converters/no-async-without-await";
3233
import { convertNoBannedTerms } from "./converters/no-banned-terms";
3334
import { convertNoBitwise } from "./converters/no-bitwise";
3435
import { convertNoConditionalAssignment } from "./converters/no-conditional-assignment";
@@ -136,6 +137,7 @@ export const converters = new Map([
136137
["no-angle-bracket-type-assertion", convertNoAngleBracketTypeAssertion],
137138
["no-any", convertNoExplicitAny],
138139
["no-arg", convertNoArg],
140+
["no-async-without-await", convertNoAsyncWithoutAwait],
139141
["no-bitwise", convertNoBitwise],
140142
["no-conditional-assignment", convertNoConditionalAssignment],
141143
["no-construct", convertNoConstruct],
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: "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: "require-await",
13+
},
14+
],
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)