Externalize spec typings, use eslint.

Tslint is deprecated, as such we have moved to eslint. Linted the project with more
stringent rules. The configuration will be changed as we figure out which rules we
should keep.
This commit is contained in:
Daniel Scalzi
2020-01-24 19:27:20 -05:00
parent 8911f54039
commit 064a664687
40 changed files with 2121 additions and 493 deletions

View File

@@ -4,24 +4,24 @@ import { JavaUtil } from './javautil'
export class PackXZExtractWrapper {
public static getPackXZExtract() {
public static getPackXZExtract(): string {
return join(process.cwd(), 'libraries', 'java', 'PackXZExtract.jar')
}
public static extractUnpack(paths: string[]) {
public static extractUnpack(paths: string[]): Promise<void> {
return PackXZExtractWrapper.execute('-packxz', paths)
}
public static extract(paths: string[]) {
public static extract(paths: string[]): Promise<void> {
return PackXZExtractWrapper.execute('-xz', paths)
}
public static unpack(paths: string[]) {
public static unpack(paths: string[]): Promise<void> {
return PackXZExtractWrapper.execute('-pack', paths)
}
private static execute(command: string, paths: string[]) {
return new Promise((resolve, reject) => {
private static execute(command: string, paths: string[]): Promise<void> {
return new Promise(resolve => {
const child = spawn(JavaUtil.getJavaExecutable(), [
'-jar',
PackXZExtractWrapper.getPackXZExtract(),
@@ -30,7 +30,7 @@ export class PackXZExtractWrapper {
])
child.stdout.on('data', (data) => console.log('[PackXZExtract]', data.toString('utf8').trim()))
child.stderr.on('data', (data) => console.error('[PackXZExtract]', data.toString('utf8').trim()))
child.on('close', (code, signal) => {
child.on('close', code => {
console.log('[PackXZExtract]', 'Exited with code', code)
resolve()
})