File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ namespace ts {
5151 const compilerOptions = host.getCompilerOptions();
5252 const languageVersion = compilerOptions.target || ScriptTarget.ES3;
5353 const modulekind = getEmitModuleKind(compilerOptions);
54- const noUnusedIdentifiers = compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters;
54+ const noUnusedIdentifiers = !! compilerOptions.noUnusedLocals || !! compilerOptions.noUnusedParameters;
5555 const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System;
5656 const strictNullChecks = compilerOptions.strictNullChecks;
5757
@@ -849,6 +849,10 @@ namespace ts {
849849 location = location.parent;
850850 }
851851
852+ if (result && nameNotFoundMessage && noUnusedIdentifiers) {
853+ result.isReferenced = true;
854+ }
855+
852856 if (!result) {
853857 result = getSymbol(globals, name, meaning);
854858 }
@@ -899,10 +903,6 @@ namespace ts {
899903 error(errorLocation, Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
900904 }
901905 }
902-
903- if (result && noUnusedIdentifiers && !isInAmbientContext(location)) {
904- result.isReferenced = true;
905- }
906906 }
907907 return result;
908908 }
You can’t perform that action at this time.
0 commit comments