Give some love to the linter

This commit is contained in:
dcodeIO
2018-03-13 14:03:57 +01:00
parent 23a7db4dc3
commit 081ac768ae
34 changed files with 526 additions and 401 deletions

View File

@ -119,7 +119,7 @@ export abstract class Node {
static createOmittedType(
range: Range
) {
): TypeNode {
return Node.createType(
Node.createIdentifierExpression("", range),
null,

View File

@ -1892,7 +1892,11 @@ export class Compiler extends DiagnosticEmitter {
return expr;
}
compileExpressionRetainType(expression: Expression, contextualType: Type, wrapSmallIntegers: bool = true) {
compileExpressionRetainType(
expression: Expression,
contextualType: Type,
wrapSmallIntegers: bool = true
): ExpressionRef {
return this.compileExpression(
expression,
contextualType == Type.void

View File

@ -27,7 +27,7 @@ export class Decompiler {
constructor() { }
/** Decompiles a module to an AST that can then be serialized. */
decompile(module: Module) {
decompile(module: Module): void {
throw new Error("not implemented");
}

View File

@ -215,7 +215,7 @@ export abstract class DiagnosticEmitter {
arg0: string | null = null,
arg1: string | null = null,
arg2: string | null = null
) {
): void {
var message = DiagnosticMessage.create(code, category, arg0, arg1, arg2).withRange(range);
this.diagnostics.push(message);
// console.log(formatDiagnosticMessage(message, true, true) + "\n"); // temporary

View File

@ -223,7 +223,7 @@ export class MemorySegment {
buffer: Uint8Array;
offset: I64;
static create(buffer: Uint8Array, offset: I64) {
static create(buffer: Uint8Array, offset: I64): MemorySegment {
var segment = new MemorySegment();
segment.buffer = buffer;
segment.offset = offset;

View File

@ -612,7 +612,7 @@ export class Program extends DiagnosticEmitter {
decorators: DecoratorNode[] | null,
prototype: FunctionPrototype,
classPrototype: ClassPrototype
) {
): void {
// handle operator annotations. operators are either instance methods taking
// a second argument of the instance's type or static methods taking two
// arguments of the instance's type. return values vary depending on the