Apply 'no-unnecessary-initializer' lint rule (#22014)

* Apply 'no-unnecessary-initializer' lint rule

Forbids `let`/`const` statements to be initialized to `undefined`, since that's the initial value by default anyway.
The auto-fixer also happened to remove two unnecessary `as number` casts in `src/harness/parallel/worker.ts`.

For historical data: to run with `--fix`, I modified the line in `Jakefile.js` that declared the `cmd` for running TSLint.

* Moved worker.ts type assertions to parameters
This commit is contained in:
Josh Goldberg
2018-03-06 07:30:40 -08:00
committed by Andy
parent 5e593acad9
commit 7826b38426
18 changed files with 50 additions and 51 deletions

View File

@@ -674,7 +674,7 @@ namespace ts {
}
// string is for exact match
let matchedPattern: Pattern | string | undefined = undefined;
let matchedPattern: Pattern | string | undefined;
if (state.compilerOptions.paths) {
if (state.traceEnabled) {
trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);