diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js')
-rw-r--r-- | node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js | 6 |
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; |