Skip to content

Commit 6a59ffa

Browse files
da-snapJosh Goldberg
authored and
Josh Goldberg
committed
Add missing converter: no-null-keyword (#202)
* Add missing converter: no-null-keyword Add converter for #173 * Add notice null type handling #173 * Fixup: unintended line merging
1 parent ecf97e7 commit 6a59ffa

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/rules/converters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { convertNoMisusedNew } from "./converters/no-misused-new";
6363
import { convertNoMultilineString } from "./converters/no-multiline-string";
6464
import { convertNoNamespace } from "./converters/no-namespace";
6565
import { convertNoNonNullAssertion } from "./converters/no-non-null-assertion";
66+
import { convertNoNullKeyword } from "./converters/no-null-keyword";
6667
import { convertNoObjectLiteralTypeAssertion } from "./converters/no-object-literal-type-assertion";
6768
import { convertNoOctalLiteral } from "./converters/no-octal-literal";
6869
import { convertNoParameterProperties } from "./converters/no-parameter-properties";
@@ -186,6 +187,7 @@ export const converters = new Map([
186187
["no-multiline-string", convertNoMultilineString],
187188
["no-namespace", convertNoNamespace],
188189
["no-non-null-assertion", convertNoNonNullAssertion],
190+
["no-null-keyword", convertNoNullKeyword],
189191
["no-object-literal-type-assertion", convertNoObjectLiteralTypeAssertion],
190192
["no-octal-literal", convertNoOctalLiteral],
191193
["no-parameter-properties", convertNoParameterProperties],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { RuleConverter } from "../converter";
2+
3+
export const convertNoNullKeyword: RuleConverter = () => {
4+
return {
5+
notices: ["Null types will no longer be handled."],
6+
rules: [
7+
{
8+
ruleName: "no-null/no-null",
9+
},
10+
],
11+
plugins: ["no-null"],
12+
};
13+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { convertNoNullKeyword } from "../no-null-keyword";
2+
3+
describe(convertNoNullKeyword, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoNullKeyword({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
notices: ["Null types will no longer be handled."],
11+
rules: [
12+
{
13+
ruleName: "no-null/no-null",
14+
},
15+
],
16+
plugins: ["no-null"],
17+
});
18+
});
19+
});

0 commit comments

Comments
 (0)