Enable max-statements-per-line lint rule (#45475)

* Enable the rule

* Fix all the violations
This commit is contained in:
Ryan Cavanaugh
2021-08-16 13:53:51 -07:00
committed by GitHub
parent 339ad92b98
commit e00b5ecd40
37 changed files with 215 additions and 109 deletions

View File

@@ -764,14 +764,14 @@ namespace ts {
}
function removeResolutionsFromProjectReferenceRedirects(filePath: Path) {
if (!fileExtensionIs(filePath, Extension.Json)) { return; }
if (!fileExtensionIs(filePath, Extension.Json)) return;
const program = resolutionHost.getCurrentProgram();
if (!program) { return; }
if (!program) return;
// If this file is input file for the referenced project, get it
const resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath);
if (!resolvedProjectReference) { return; }
if (!resolvedProjectReference) return;
// filePath is for the projectReference and the containing file is from this project reference, invalidate the resolution
resolvedProjectReference.commandLine.fileNames.forEach(f => removeResolutionsOfFile(resolutionHost.toPath(f)));