[CORL-678] Transition to eslint (#2634)

* chore: setup eslint

* chore: tslint checks with types & check for import order

* chore: complete eslint transition

* fix: tests

* fix: linting after rebase, faster lint for lint-staged

* chore: remove line

* fix: lint rules

* feat: add a11y linter and fix errors

* fix: tests
This commit is contained in:
Vinh
2019-10-15 22:56:38 +00:00
committed by Wyatt Johnson
parent b0e0ba6633
commit 3bfcc509d2
569 changed files with 2592 additions and 1925 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ export type DeepWritableObject<T> = T extends object
? Array<DeepWritableObject<U>>
: T[P] extends (ReadonlyArray<infer V> | undefined)
? ReadonlyArray<DeepWritableObject<V>>
: DeepWritableObject<T[P]>
: DeepWritableObject<T[P]>;
}
: T;
@@ -44,7 +44,7 @@ export type DeepNullable<T> = T extends object
? Array<DeepNullable<U>>
: T[P] extends (ReadonlyArray<infer V> | undefined)
? ReadonlyArray<DeepNullable<V>>
: DeepNullable<T[P]>
: DeepNullable<T[P]>;
}
: T | null;
@@ -57,6 +57,6 @@ export type DeepPartial<T> = T extends object
? Array<DeepPartial<U>>
: T[P] extends (ReadonlyArray<infer V> | undefined)
? ReadonlyArray<DeepPartial<V>>
: DeepPartial<T[P]>
: DeepPartial<T[P]>;
}
: T;
+3 -1
View File
@@ -1,3 +1,5 @@
const END_SLASH_REGEX = /\/$/;
export default function ensureEndSlash(p: string) {
return p.match(/\/$/) ? p : `${p}/`;
return END_SLASH_REGEX.exec(p) ? p : `${p}/`;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/** A promisified timeout. */
export default function timeout(ms: number = 0) {
export default function timeout(ms = 0) {
return new Promise(resolve => setTimeout(resolve, ms));
}
+2 -2
View File
@@ -1,8 +1,8 @@
import fs from "fs";
import path from "path";
export let revision: string = "";
export let version: string = "";
export let revision = "";
export let version = "";
// Pull the version information from the package.json file.
const packagePath = path.join(__dirname, "..", "..", "..", "package.json");