Skip to content

Commit

Permalink
Use --noImplicitAny.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfn committed Jun 18, 2016
1 parent 1aa616c commit 8cbc769
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
6 changes: 1 addition & 5 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ function handleKeyEvent(key: string): Promise<Boolean> {
}

return modeHandler.handleKeyEvent(key);
}

process.on('unhandledRejection', function(reason, p){
console.log("Possibly Unhandled Rejection at: Promise ", p, " reason: ", reason);
});
}
2 changes: 1 addition & 1 deletion src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class Actions {
}
}

export function RegisterAction(action) {
export function RegisterAction(action: typeof BaseAction): void {
Actions.allActions.push({ type: action, action: new action() });
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd_line/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function parseCommand(state : ParserState, commandLine : node.CommandLine) : IPa
var tok = state.next();
switch (tok.type) {
case token.TokenType.CommandName:
var commandParser = commandParsers[tok.content];
var commandParser = (commandParsers as any)[tok.content];
if (!commandParser) {
throw new Error("not implemented or not a valid command");
}
Expand Down
9 changes: 4 additions & 5 deletions src/cmd_line/subparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import {parseQuitCommandArgs} from './subparsers/quit';
import {parseWriteCommandArgs} from './subparsers/write';

// TODO: add type for this dict.
// maps command names to parsers for said commands.
export const commandParsers = {
'w': parseWriteCommandArgs,
'write': parseWriteCommandArgs,
w: parseWriteCommandArgs,
write: parseWriteCommandArgs,

'quit': parseQuitCommandArgs,
'q': parseQuitCommandArgs
quit: parseQuitCommandArgs,
q: parseQuitCommandArgs
};
8 changes: 4 additions & 4 deletions src/configuration/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface IKeyMapper {

class KeyMapperEsEsQwerty implements IKeyMapper {
private _name = 'es-ES (QWERTY)';
private _mappings = {
private _mappings: { [key: string]: string } = {
'>': ':',
'<': ';',
'`': '<',
Expand All @@ -66,7 +66,7 @@ class KeyMapperEsEsQwerty implements IKeyMapper {

class KeyMapperDeDeQwertz implements IKeyMapper {
private _name = 'de-DE (QWERTZ)';
private _mappings = {
private _mappings: {[key: string]: string } = {
'>': ':',
'\\': '<',
'<': ';',
Expand All @@ -85,7 +85,7 @@ class KeyMapperDeDeQwertz implements IKeyMapper {

class KeyMapperDaDKQwerty implements IKeyMapper {
private _name = 'da-DK (QWERTY)';
private _mappings = {
private _mappings: { [key: string]: string } = {
'>': ':',
'\\': '<',
'<': ';',
Expand All @@ -104,7 +104,7 @@ class KeyMapperDaDKQwerty implements IKeyMapper {

class KeyMapperSvSEQwerty implements IKeyMapper {
private _name = "sv-SE (QWERTY)";
private _mappings = {
private _mappings: { [key: string]: string } = {
'oem_102': '<',
'shift+oem_102': '>',
'>': ':',
Expand Down
2 changes: 1 addition & 1 deletion src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class VimState {
/**
* The current full action we are building up.
*/
public currentFullAction = [];
public currentFullAction: string[] = [];

/**
* The position the cursor will be when this action finishes.
Expand Down
2 changes: 1 addition & 1 deletion src/motion/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class Position extends vscode.Position {

private makeWordRegex(characterSet: string) : RegExp {
let escaped = characterSet && _.escapeRegExp(characterSet);
let segments = [];
let segments: string[] = [];
segments.push(`([^\\s${escaped}]+)`);
segments.push(`[${escaped}]+`);
segments.push(`$^`);
Expand Down
6 changes: 3 additions & 3 deletions test/testSimplifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getTestingFunctions(modeHandler: ModeHandler) {
let niceStack = (new Error).stack.split('\n').splice(2, 1).join('\n');

test(testObj.title, async () => testWithObject(testObj)
.catch(reason => {
.catch((reason: Error) => {
reason.stack = niceStack;
throw reason;
})
Expand All @@ -24,7 +24,7 @@ export function getTestingFunctions(modeHandler: ModeHandler) {
let niceStack = (new Error).stack.split('\n').splice(2, 1).join('\n');

test.only(testObj.title, async () => testWithObject(testObj)
.catch(reason => {
.catch((reason: Error) => {
reason.stack = niceStack;
throw reason;
})
Expand Down Expand Up @@ -148,7 +148,7 @@ class TestObjectHelper {
function tokenizeKeySequence(sequence: string): string[] {
let isBracketedKey = false;
let key = "";
let result = [];
let result: string[] = [];

for (const char of sequence) {
key += char;
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"module": "commonjs",
"target": "es6",
"outDir": "out",
"noImplicitAny": true,
"noLib": true,
"sourceMap": true,
"experimentalDecorators": true
Expand Down

0 comments on commit 8cbc769

Please sign in to comment.