Skip to content

Commit

Permalink
chore: add @typescript-eslint/semi rule (#970)
Browse files Browse the repository at this point in the history
To enforce the presence of the semicolons.
  • Loading branch information
RomainMuller authored and mergify[bot] committed Nov 12, 2019
1 parent fe9d63e commit 948000d
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 22 deletions.
4 changes: 4 additions & 0 deletions eslint-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ rules:
'@typescript-eslint/require-await':
- error

'@typescript-eslint/semi':
- error
- 'always'

'@typescript-eslint/type-annotation-spacing':
- error

Expand Down
4 changes: 2 additions & 2 deletions packages/codemaker/lib/filebuff.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra'
import * as path from 'path'
import * as fs from 'fs-extra';
import * as path from 'path';

/**
* Buffers the text of a file for later saving.
Expand Down
4 changes: 2 additions & 2 deletions packages/codemaker/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './codemaker'
export * from './case-utils'
export * from './codemaker';
export * from './case-utils';
4 changes: 2 additions & 2 deletions packages/jsii-kernel/test/kernel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function defineTest(name: string, method: (sandbox: Kernel) => Promise<any> | an

defineTest.skip = function (name: string, method: (sandbox: Kernel) => Promise<any> | any) {
return defineTest(name, method, test.skip);
}
};

defineTest('stats() return sandbox statistics', (sandbox) => {
const stats = sandbox.stats({ });
Expand Down Expand Up @@ -842,7 +842,7 @@ defineTest('loading a module twice idepotently succeeds', async (sandbox) => {
defineTest('fails if trying to load two different versions of the same module', async (sandbox) => {
const tarball = await preparePackage('jsii-calc', false);
return expect(() => sandbox.load({ tarball, name: 'jsii-calc', version: '99.999.9' }))
.toThrow(/Multiple versions .+ and .+ of the package 'jsii-calc' cannot be loaded together/)
.toThrow(/Multiple versions .+ and .+ of the package 'jsii-calc' cannot be loaded together/);
});

defineTest('node.js standard library', async (sandbox) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/jsii-pacmak/bin/jsii-pacmak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ import { ALL_BUILDERS, TargetName } from '../lib/targets';
});

try {
const requestedTargets = argv.targets && argv.targets.map(t => `${t}`)
const requestedTargets = argv.targets && argv.targets.map(t => `${t}`);
const targetSets = sliceTargets(modulesToPackage, requestedTargets, argv['force-target']);

if (targetSets.every(s => s.modules.length === 0)) {
Expand Down Expand Up @@ -202,7 +202,7 @@ function allAvailableTargets(modules: JsiiModule[]) {
const ret = new Set<string>();
for (const module of modules) {
for (const target of module.availableTargets) {
ret.add(target)
ret.add(target);
}
}
return Array.from(ret);
Expand Down
18 changes: 9 additions & 9 deletions packages/jsii-pacmak/lib/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export abstract class Generator implements IGenerator {
throw new Error('Malformed assembly name. Expecting either <name> or @<scope>/<name>');
}

return `${name}@${this.assembly.version}.jsii.tgz`
return `${name}@${this.assembly.version}.jsii.tgz`;
}

/**
Expand Down Expand Up @@ -208,9 +208,9 @@ export abstract class Generator implements IGenerator {

protected onBeginMethods(_cls: spec.ClassType) { /* noop */ }
protected abstract onMethod(cls: spec.ClassType, method: spec.Method): void;
protected abstract onMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void
protected abstract onMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void;
protected abstract onStaticMethod(cls: spec.ClassType, method: spec.Method): void;
protected abstract onStaticMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void
protected abstract onStaticMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void;
protected onEndMethods(_cls: spec.ClassType) { /* noop */ }

//
Expand Down Expand Up @@ -240,8 +240,8 @@ export abstract class Generator implements IGenerator {
const visitChildren = () => {
Object.keys(node.children).sort().forEach(name => {
this.visit(node.children[name], names.concat(name));
})
}
});
};

if (node.fqn) {
const type = this.assembly.types && this.assembly.types[node.fqn];
Expand All @@ -262,7 +262,7 @@ export abstract class Generator implements IGenerator {
this.onEndClass(classSpec);
break;
case spec.TypeKind.Enum:
const enumSpec = type as spec.EnumType
const enumSpec = type as spec.EnumType;
this.onBeginEnum(enumSpec);
this.visitEnum(enumSpec);
visitChildren();
Expand Down Expand Up @@ -331,7 +331,7 @@ export abstract class Generator implements IGenerator {
//

const remaining: spec.Parameter[] = clone(method.parameters);
let next: spec.Parameter | undefined
let next: spec.Parameter | undefined;

next = remaining.pop();
// Parameter is optional if it's type is optional, and all subsequent parameters are optional/variadic
Expand All @@ -352,7 +352,7 @@ export abstract class Generator implements IGenerator {
if (ifc.properties) {
ifc.properties.forEach(prop => {
this.onInterfaceProperty(ifc, prop);
})
});
}

if (ifc.methods) {
Expand Down Expand Up @@ -406,7 +406,7 @@ export abstract class Generator implements IGenerator {
if (this.hasField(cls, prop)) {
this.onField(cls, prop, spec.isUnionTypeReference(prop.type) ? prop.type : undefined);
}
})
});

cls.properties.forEach(prop => {
if (!spec.isUnionTypeReference(prop.type)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-runtime/lib/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class KernelHost {
this.processRequest(req, () => {
// Schedule the call to run on the next event loop iteration to
// avoid recursion.
setImmediate(() => this.run())
setImmediate(() => this.run());
});
}

Expand Down
6 changes: 3 additions & 3 deletions packages/jsii-runtime/lib/in-out.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SyncStdio } from './sync-stdio'
import { api } from 'jsii-kernel'
import { SyncStdio } from './sync-stdio';
import { api } from 'jsii-kernel';

export type Output =
{ hello: string } |
Expand All @@ -13,7 +13,7 @@ export type Input =
{ complete: api.CompleteRequest };

export class InputOutput {
public debug = false
public debug = false;

private readonly stdio = new SyncStdio();

Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-runtime/lib/sync-stdio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs'
import * as fs from 'fs';

const STDIN_FD = 0;
const STDOUT_FD = 1;
Expand Down

0 comments on commit 948000d

Please sign in to comment.