mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Merge pull request #13006 from SaschaNaz/lintfix
Fix latest tslint errors
This commit is contained in:
@@ -113,7 +113,7 @@ namespace ts.server {
|
||||
if (len > 1) {
|
||||
let insertedNodes = <LineCollection[]>new Array(len - 1);
|
||||
let startNode = <LineCollection>leafNode;
|
||||
for (let i = 1, len = lines.length; i < len; i++) {
|
||||
for (let i = 1; i < lines.length; i++) {
|
||||
insertedNodes[i - 1] = new LineLeaf(lines[i]);
|
||||
}
|
||||
let pathIndex = this.startPath.length - 2;
|
||||
@@ -341,8 +341,7 @@ namespace ts.server {
|
||||
let snap = this.versions[this.currentVersionToIndex()];
|
||||
if (this.changes.length > 0) {
|
||||
let snapIndex = snap.index;
|
||||
for (let i = 0, len = this.changes.length; i < len; i++) {
|
||||
const change = this.changes[i];
|
||||
for (const change of this.changes) {
|
||||
snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText);
|
||||
}
|
||||
snap = new LineIndexSnapshot(this.currentVersion + 1, this);
|
||||
@@ -366,8 +365,7 @@ namespace ts.server {
|
||||
const textChangeRanges: ts.TextChangeRange[] = [];
|
||||
for (let i = oldVersion + 1; i <= newVersion; i++) {
|
||||
const snap = this.versions[this.versionToIndex(i)];
|
||||
for (let j = 0, len = snap.changesSincePreviousVersion.length; j < len; j++) {
|
||||
const textChange = snap.changesSincePreviousVersion[j];
|
||||
for (const textChange of snap.changesSincePreviousVersion) {
|
||||
textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange();
|
||||
}
|
||||
}
|
||||
@@ -471,7 +469,7 @@ namespace ts.server {
|
||||
load(lines: string[]) {
|
||||
if (lines.length > 0) {
|
||||
const leaves: LineLeaf[] = [];
|
||||
for (let i = 0, len = lines.length; i < len; i++) {
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
leaves[i] = new LineLeaf(lines[i]);
|
||||
}
|
||||
this.root = LineIndex.buildTreeFromBottom(leaves);
|
||||
@@ -643,8 +641,7 @@ namespace ts.server {
|
||||
updateCounts() {
|
||||
this.totalChars = 0;
|
||||
this.totalLines = 0;
|
||||
for (let i = 0, len = this.children.length; i < len; i++) {
|
||||
const child = this.children[i];
|
||||
for (const child of this.children) {
|
||||
this.totalChars += child.charCount();
|
||||
this.totalLines += child.lineCount();
|
||||
}
|
||||
|
||||
@@ -409,7 +409,8 @@ namespace ts.server {
|
||||
function parseLoggingEnvironmentString(logEnvStr: string): LogOptions {
|
||||
const logEnv: LogOptions = { logToFile: true };
|
||||
const args = logEnvStr.split(" ");
|
||||
for (let i = 0, len = args.length; i < (len - 1); i += 2) {
|
||||
const len = args.length - 1;
|
||||
for (let i = 0; i < len; i += 2) {
|
||||
const option = args[i];
|
||||
const value = args[i + 1];
|
||||
if (option && value) {
|
||||
|
||||
Reference in New Issue
Block a user