aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js')
-rw-r--r--node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js b/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
index b147fe076..e02c3a905 100644
--- a/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
+++ b/node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js
@@ -28,23 +28,23 @@ var Rule = (function (_super) {
Rule.prototype.apply = function (sourceFile) {
return this.applyWithFunction(sourceFile, walk);
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "no-unnecessary-initializer",
+ description: "Forbids a 'var'/'let' statement or destructuring initializer to be initialized to 'undefined'.",
+ hasFix: true,
+ optionsDescription: "Not configurable.",
+ options: null,
+ optionExamples: [true],
+ type: "style",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING = "Unnecessary initialization to 'undefined'.";
+ Rule.FAILURE_STRING_PARAMETER = "Use an optional parameter instead of initializing to 'undefined'. " +
+ "Also, the type declaration does not need to include '| undefined'.";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "no-unnecessary-initializer",
- description: "Forbids a 'var'/'let' statement or destructuring initializer to be initialized to 'undefined'.",
- hasFix: true,
- optionsDescription: "Not configurable.",
- options: null,
- optionExamples: [true],
- type: "style",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING = "Unnecessary initialization to 'undefined'.";
-Rule.FAILURE_STRING_PARAMETER = "Use an optional parameter instead of initializing to 'undefined'. " +
- "Also, the type declaration does not need to include '| undefined'.";
exports.Rule = Rule;
function walk(ctx) {
ts.forEachChild(ctx.sourceFile, function cb(node) {
@@ -72,7 +72,6 @@ function walk(ctx) {
}
}
});
- break;
}
}
ts.forEachChild(node, cb);