mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
[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:
@@ -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;
|
||||
|
||||
@@ -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,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));
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user