aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js')
-rw-r--r--node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js b/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
index 794c668fb..110938857 100644
--- a/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
+++ b/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
@@ -36,6 +36,7 @@ var Rule = /** @class */ (function (_super) {
optionsDescription: "Not configurable.",
options: null,
optionExamples: [true],
+ rationale: Lint.Utils.dedent(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n Values in JavaScript default to `undefined`.\n There's no need to do so manually.\n "], ["\n Values in JavaScript default to \\`undefined\\`.\n There's no need to do so manually.\n "]))),
type: "style",
typescriptOnly: false,
};
@@ -53,7 +54,7 @@ function walk(ctx) {
checkInitializer(node);
break;
case ts.SyntaxKind.VariableDeclaration:
- if (!tsutils_1.isBindingPattern(node.name) && !Lint.isNodeFlagSet(node.parent, ts.NodeFlags.Const)) {
+ if (!tsutils_1.isBindingPattern(node.name) && !tsutils_1.isNodeFlagSet(node.parent, ts.NodeFlags.Const)) {
checkInitializer(node);
}
break;
@@ -82,7 +83,7 @@ function walk(ctx) {
}
}
function failWithFix(node) {
- var fix = Lint.Replacement.deleteFromTo(Lint.childOfKind(node, ts.SyntaxKind.EqualsToken).pos, node.end);
+ var fix = Lint.Replacement.deleteFromTo(tsutils_1.getChildOfKind(node, ts.SyntaxKind.EqualsToken).pos, node.end);
ctx.addFailureAtNode(node, Rule.FAILURE_STRING, fix);
}
}
@@ -102,3 +103,4 @@ function isUndefined(node) {
node.kind === ts.SyntaxKind.Identifier &&
node.originalKeywordKind === ts.SyntaxKind.UndefinedKeyword;
}
+var templateObject_1;