Skip to content

Commit 948000d

Browse files
RomainMullermergify[bot]
authored andcommitted
chore: add @typescript-eslint/semi rule (#970)
To enforce the presence of the semicolons.
1 parent fe9d63e commit 948000d

9 files changed

Lines changed: 26 additions & 22 deletions

File tree

eslint-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ rules:
105105
'@typescript-eslint/require-await':
106106
- error
107107

108+
'@typescript-eslint/semi':
109+
- error
110+
- 'always'
111+
108112
'@typescript-eslint/type-annotation-spacing':
109113
- error
110114

packages/codemaker/lib/filebuff.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from 'fs-extra'
2-
import * as path from 'path'
1+
import * as fs from 'fs-extra';
2+
import * as path from 'path';
33

44
/**
55
* Buffers the text of a file for later saving.

packages/codemaker/lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './codemaker'
2-
export * from './case-utils'
1+
export * from './codemaker';
2+
export * from './case-utils';

packages/jsii-kernel/test/kernel.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function defineTest(name: string, method: (sandbox: Kernel) => Promise<any> | an
4444

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

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

848848
defineTest('node.js standard library', async (sandbox) => {

packages/jsii-pacmak/bin/jsii-pacmak.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ import { ALL_BUILDERS, TargetName } from '../lib/targets';
120120
});
121121

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

126126
if (targetSets.every(s => s.modules.length === 0)) {
@@ -202,7 +202,7 @@ function allAvailableTargets(modules: JsiiModule[]) {
202202
const ret = new Set<string>();
203203
for (const module of modules) {
204204
for (const target of module.availableTargets) {
205-
ret.add(target)
205+
ret.add(target);
206206
}
207207
}
208208
return Array.from(ret);

packages/jsii-pacmak/lib/generator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export abstract class Generator implements IGenerator {
122122
throw new Error('Malformed assembly name. Expecting either <name> or @<scope>/<name>');
123123
}
124124

125-
return `${name}@${this.assembly.version}.jsii.tgz`
125+
return `${name}@${this.assembly.version}.jsii.tgz`;
126126
}
127127

128128
/**
@@ -208,9 +208,9 @@ export abstract class Generator implements IGenerator {
208208

209209
protected onBeginMethods(_cls: spec.ClassType) { /* noop */ }
210210
protected abstract onMethod(cls: spec.ClassType, method: spec.Method): void;
211-
protected abstract onMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void
211+
protected abstract onMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void;
212212
protected abstract onStaticMethod(cls: spec.ClassType, method: spec.Method): void;
213-
protected abstract onStaticMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void
213+
protected abstract onStaticMethodOverload(cls: spec.ClassType, overload: spec.Method, originalMethod: spec.Method): void;
214214
protected onEndMethods(_cls: spec.ClassType) { /* noop */ }
215215

216216
//
@@ -240,8 +240,8 @@ export abstract class Generator implements IGenerator {
240240
const visitChildren = () => {
241241
Object.keys(node.children).sort().forEach(name => {
242242
this.visit(node.children[name], names.concat(name));
243-
})
244-
}
243+
});
244+
};
245245

246246
if (node.fqn) {
247247
const type = this.assembly.types && this.assembly.types[node.fqn];
@@ -262,7 +262,7 @@ export abstract class Generator implements IGenerator {
262262
this.onEndClass(classSpec);
263263
break;
264264
case spec.TypeKind.Enum:
265-
const enumSpec = type as spec.EnumType
265+
const enumSpec = type as spec.EnumType;
266266
this.onBeginEnum(enumSpec);
267267
this.visitEnum(enumSpec);
268268
visitChildren();
@@ -331,7 +331,7 @@ export abstract class Generator implements IGenerator {
331331
//
332332

333333
const remaining: spec.Parameter[] = clone(method.parameters);
334-
let next: spec.Parameter | undefined
334+
let next: spec.Parameter | undefined;
335335

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

358358
if (ifc.methods) {
@@ -406,7 +406,7 @@ export abstract class Generator implements IGenerator {
406406
if (this.hasField(cls, prop)) {
407407
this.onField(cls, prop, spec.isUnionTypeReference(prop.type) ? prop.type : undefined);
408408
}
409-
})
409+
});
410410

411411
cls.properties.forEach(prop => {
412412
if (!spec.isUnionTypeReference(prop.type)) {

packages/jsii-runtime/lib/host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class KernelHost {
2020
this.processRequest(req, () => {
2121
// Schedule the call to run on the next event loop iteration to
2222
// avoid recursion.
23-
setImmediate(() => this.run())
23+
setImmediate(() => this.run());
2424
});
2525
}
2626

packages/jsii-runtime/lib/in-out.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { SyncStdio } from './sync-stdio'
2-
import { api } from 'jsii-kernel'
1+
import { SyncStdio } from './sync-stdio';
2+
import { api } from 'jsii-kernel';
33

44
export type Output =
55
{ hello: string } |
@@ -13,7 +13,7 @@ export type Input =
1313
{ complete: api.CompleteRequest };
1414

1515
export class InputOutput {
16-
public debug = false
16+
public debug = false;
1717

1818
private readonly stdio = new SyncStdio();
1919

packages/jsii-runtime/lib/sync-stdio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as fs from 'fs'
1+
import * as fs from 'fs';
22

33
const STDIN_FD = 0;
44
const STDOUT_FD = 1;

0 commit comments

Comments
 (0)