Upgrade typescript 2.2.1->2.3.2. tslint 3.10.2->2.3.2. Fix errors (#1614)

This commit is contained in:
Jason Poon 2017-04-30 01:25:06 -05:00 committed by GitHub
parent 2551f5d7a9
commit 675bc23214
15 changed files with 492 additions and 490 deletions

View File

@ -457,20 +457,20 @@
"lodash": "^4.12.0"
},
"devDependencies": {
"@types/mocha": "^2.2.39",
"@types/node": "^6.0.41",
"gulp": "^3.9.1",
"gulp-bump": "^2.1.0",
"gulp-git": "^1.7.1",
"gulp-inject-string": "^1.1.0",
"gulp-shell": "^0.5.2",
"gulp-tag-version": "^1.3.0",
"gulp-tslint": "^6.1.2",
"gulp-tslint": "^8.0.0",
"gulp-typings": "^2.0.0",
"merge-stream": "^1.0.0",
"tslint": "^3.10.2",
"typescript": "^2.2.1",
"mocha": "^3.2.0",
"vscode": "^1.0.5",
"@types/node": "^6.0.41",
"@types/mocha": "^2.2.39"
"tslint": "^5.1.0",
"typescript": "^2.3.2",
"vscode": "^1.0.5"
}
}

View File

@ -7012,9 +7012,9 @@ class CommandSurroundAddToReplacement extends BaseCommand {
// Convert a few shortcuts to the correct surround characters when NOT entering a tag
if (vimState.surround.replacement.length === 0) {
if (stringToAdd === "b") { stringToAdd = "("; };
if (stringToAdd === "B") { stringToAdd = "{"; };
if (stringToAdd === "r") { stringToAdd = "["; };
if (stringToAdd === "b") { stringToAdd = "("; }
if (stringToAdd === "B") { stringToAdd = "{"; }
if (stringToAdd === "r") { stringToAdd = "["; }
}
vimState.surround.replacement += stringToAdd;

View File

@ -61,9 +61,9 @@ export class WriteCommand extends node.CommandBase {
return this.save(modeHandler);
} catch (accessErr) {
if (this.arguments.bang) {
fs.chmod(modeHandler.vimState.editor.document.fileName, 666, (e) => {
fs.chmod(modeHandler.vimState.editor.document.fileName, 666, e => {
if (e) {
modeHandler.setStatusBarText(e.message);
return modeHandler.setStatusBarText(e.message);
} else {
return this.save(modeHandler);
}

View File

@ -162,7 +162,7 @@ module LexerFunctions {
var args = emitToken(TokenType.CommandArgs, state);
if (args) {
tokens.push(args);
};
}
break;
}
}
@ -191,7 +191,7 @@ module LexerFunctions {
state.ignore();
if (!state.isAtEof) {
state.skip("/");
};
}
return lexRange;
}

View File

@ -20,8 +20,10 @@ export async function showCmdLine(initialText: string, modeHandler : ModeHandler
try {
const cmdString = await vscode.window.showInputBox(options);
await runCmdLine(cmdString!, modeHandler);
return;
} catch (e) {
modeHandler.setStatusBarText(e.toString());
return;
}
}
@ -37,7 +39,9 @@ export async function runCmdLine(command : string, modeHandler : ModeHandler) :
}
await cmd.execute(modeHandler.vimState.editor, modeHandler);
return;
} catch (e) {
modeHandler.setStatusBarText(e.toString());
return;
}
}

View File

@ -19,7 +19,7 @@ function parsePattern(pattern: string, scanner: Scanner, delimiter: string): [st
return [pattern, true];
} else if (currentChar === "\\") {
if (!scanner.isAtEof) {
let currentChar = scanner.next();
currentChar = scanner.next();
if (currentChar !== delimiter) {
pattern += "\\";

View File

@ -40,7 +40,7 @@ export function parseWriteCommandArgs(args : string) : WriteCommand {
scanner.expect('=');
scanner.ignore();
while (!scanner.isAtEof) {
let c = scanner.next();
c = scanner.next();
if (c !== ' ' && c !== '\t') {
continue;
}

View File

@ -30,7 +30,7 @@ export function parseWriteQuitCommandArgs(args : string) : WriteQuitCommand {
scanner.expect('=');
scanner.ignore();
while (!scanner.isAtEof) {
let c = scanner.next();
c = scanner.next();
if (c !== ' ' && c !== '\t') {
continue;
}

View File

@ -8,7 +8,7 @@ export type OptionValue = number | string | boolean;
export type ValueMapping = {
[key: number]: OptionValue
[key: string]: OptionValue
}
};
export interface IHandleKeys {
[key: string]: boolean;

View File

@ -1368,7 +1368,7 @@ export class ModeHandler implements vscode.Disposable {
accumulatedPositionDifferences[command.cursorIndex].push(command.diff);
}
});
};
}
} else {
// This is the common case!

View File

@ -844,7 +844,7 @@ export class Position extends vscode.Position {
private getLastWordEndWithRegex(regex: RegExp) : Position {
for (let currentLine = this.line; currentLine < TextEditor.getLineCount(); currentLine++) {
let positions = this.getAllEndPositions(TextEditor.getLineAt(new vscode.Position(currentLine, 0)).text, regex);
let index = _.findIndex(positions, index => index >= this.character || currentLine !== this.line);
let index = _.findIndex(positions, i => i >= this.character || currentLine !== this.line);
let newCharacter = 0;
if (index === -1) {
newCharacter = positions[positions.length - 1];

View File

@ -13,7 +13,7 @@ export enum RegisterMode {
CharacterWise,
LineWise,
BlockWise,
};
}
export type RegisterContent = string | string[] | RecordedState;

View File

@ -239,4 +239,4 @@ async function testIt(modeHandler: ModeHandler, testObj: ITestObject): Promise<v
}
export { ITestObject, testIt }
export { ITestObject, testIt };

View File

@ -1,9 +1,11 @@
{
"compilerOptions": {
"allowUnusedLabels": false,
"module": "commonjs",
"target": "es6",
"outDir": "out",
"noImplicitAny": true,
"noImplicitReturns": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es6"

View File

@ -17,7 +17,6 @@
"interface-name": false,
"jsdoc-format": true,
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
140
@ -38,9 +37,8 @@
"trace"
],
"no-construct": true,
"no-constructor-vars": true,
"no-parameter-properties": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
@ -52,7 +50,6 @@
"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
@ -78,7 +75,6 @@
],
"typedef": false,
"typedef-whitespace": false,
"use-strict": false,
"variable-name": false,
"whitespace": [
true,