Skip to content

Commit b7c0868

Browse files
bouzuyaJosh Goldberg
authored and
Josh Goldberg
committed
fix no-underscore-dangle (#291)
1 parent 82646aa commit b7c0868

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/rules/converters/tests/variable-name.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ describe(convertVariableName, () => {
198198
},
199199
{
200200
notices: [IgnoreLeadingTrailingIdentifierMsg],
201-
ruleArguments: ["off"],
202201
ruleName: "no-underscore-dangle",
202+
ruleSeverity: "off",
203203
},
204204
{
205205
ruleName: "id-blacklist",
@@ -224,8 +224,8 @@ describe(convertVariableName, () => {
224224
},
225225
{
226226
notices: [IgnoreLeadingTrailingIdentifierMsg],
227-
ruleArguments: ["off"],
228227
ruleName: "no-underscore-dangle",
228+
ruleSeverity: "off",
229229
},
230230
{
231231
ruleName: "id-blacklist",
@@ -254,8 +254,8 @@ describe(convertVariableName, () => {
254254
},
255255
{
256256
notices: [IgnoreLeadingTrailingIdentifierMsg],
257-
ruleArguments: ["off"],
258257
ruleName: "no-underscore-dangle",
258+
ruleSeverity: "off",
259259
},
260260
{
261261
ruleName: "id-blacklist",
@@ -288,8 +288,8 @@ describe(convertVariableName, () => {
288288
},
289289
{
290290
ruleName: "no-underscore-dangle",
291-
ruleArguments: ["off"],
292291
notices: [IgnoreLeadingTrailingIdentifierMsg],
292+
ruleSeverity: "off",
293293
},
294294
{
295295
ruleName: "id-blacklist",

src/rules/converters/variable-name.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ export const convertVariableName: RuleConverter = tslintRule => {
5656
};
5757

5858
const getUnderscoreDangleRuleOptions = () => {
59-
const underscoreDangleOptionArguments: string[] = [];
59+
let underscoreDangleOptionSeverity: string | null = null;
6060
const underscoreDangleOptionNotice: string[] = [];
6161

6262
if (hasCheckFormat && (allowedLeadingUnderscore || allowedTrailingUnderscore)) {
63-
underscoreDangleOptionArguments.push("off");
63+
underscoreDangleOptionSeverity = "off";
6464
underscoreDangleOptionNotice.push(IgnoreLeadingTrailingIdentifierMsg);
6565
} else {
6666
underscoreDangleOptionNotice.push(ForbiddenLeadingTrailingIdentifierMsg);
6767
}
6868

6969
return {
7070
notices: underscoreDangleOptionNotice,
71-
...(underscoreDangleOptionArguments.length !== 0 && {
72-
ruleArguments: underscoreDangleOptionArguments,
71+
...(underscoreDangleOptionSeverity !== null && {
72+
ruleSeverity: underscoreDangleOptionSeverity,
7373
}),
7474
ruleName: "no-underscore-dangle",
7575
};

0 commit comments

Comments
 (0)