Skip to content

Commit 99cd23f

Browse files
author
Josh Goldberg
authored
Added no-with-statement converter (#1070)
1 parent b3ab149 commit 99cd23f

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import { convertNoUseBeforeDeclare } from "./ruleConverters/no-use-before-declar
109109
import { convertNoVarKeyword } from "./ruleConverters/no-var-keyword";
110110
import { convertNoVarRequires } from "./ruleConverters/no-var-requires";
111111
import { convertNoVoidExpression } from "./ruleConverters/no-void-expression";
112+
import { convertNoWithStatement } from "./ruleConverters/no-with-statement";
112113
import { convertObjectLiteralKeyQuotes } from "./ruleConverters/object-literal-key-quotes";
113114
import { convertObjectLiteralShorthand } from "./ruleConverters/object-literal-shorthand";
114115
import { convertOneLine } from "./ruleConverters/one-line";
@@ -376,6 +377,7 @@ export const ruleConverters = new Map([
376377
["no-var-keyword", convertNoVarKeyword],
377378
["no-var-requires", convertNoVarRequires],
378379
["no-void-expression", convertNoVoidExpression],
380+
["no-with-statement", convertNoWithStatement],
379381
["object-literal-key-quotes", convertObjectLiteralKeyQuotes],
380382
["object-literal-shorthand", convertObjectLiteralShorthand],
381383
["one-line", convertOneLine],
@@ -471,5 +473,4 @@ export const ruleConverters = new Map([
471473
// ["max-func-body-length", convertMaxFuncBodyLength],
472474
// ["no-function-expression", convertNoFunctionExpression], // ban-syntax config
473475
// ["no-suspicious-comment", convertNoSuspiciousComment],
474-
// ["no-with-statement", convertNoWithStatement],
475476
]);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RuleConverter } from "../ruleConverter";
2+
3+
export const convertNoWithStatement: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "no-with",
8+
},
9+
],
10+
};
11+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { convertNoWithStatement } from "../no-with-statement";
2+
3+
describe(convertNoWithStatement, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoWithStatement({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "no-with",
13+
},
14+
],
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)