Apply 'no-unnecessary-type-assertion' lint rule (#22005)

* Apply 'no-unnecessary-type-assertion' lint rule

* Fix type error

* Fix tsconfig.json

* Add --format back
This commit is contained in:
Andy
2018-02-16 18:38:00 -08:00
committed by GitHub
parent 8e078b9fde
commit b3edc8f9f4
52 changed files with 495 additions and 451 deletions

View File

@@ -2026,7 +2026,7 @@ namespace ts.server {
}
else {
configFileErrors = project.getAllProjectErrors();
this.sendConfigFileDiagEvent(project as ConfiguredProject, fileName);
this.sendConfigFileDiagEvent(project, fileName);
}
}
else {

View File

@@ -765,13 +765,13 @@ namespace ts.server {
for (let i = 0; i < splitNodeCount; i++) {
splitNodes[i] = new LineNode();
}
let splitNode = <LineNode>splitNodes[0];
let splitNode = splitNodes[0];
while (nodeIndex < nodeCount) {
splitNode.add(nodes[nodeIndex]);
nodeIndex++;
if (splitNode.children.length === lineCollectionCapacity) {
splitNodeIndex++;
splitNode = <LineNode>splitNodes[splitNodeIndex];
splitNode = splitNodes[splitNodeIndex];
}
}
for (let i = splitNodes.length - 1; i >= 0; i--) {
@@ -785,7 +785,7 @@ namespace ts.server {
}
this.updateCounts();
for (let i = 0; i < splitNodeCount; i++) {
(<LineNode>splitNodes[i]).updateCounts();
splitNodes[i].updateCounts();
}
return splitNodes;
}