Typescript config parity with Browsertrix repo (#289)
Follow-up from #288 This matches the strictness rules with the Browsertrix repo, specifically `noImplicitAny`, and then adds `// @ts-expect-error`s to suppress existing errors this change raises. This'll help us keep code quality high moving forward. Going to just directly merge this once it passes CI; as with #288, this doesn't change any code, just comments.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*eslint-env node */
|
||||
|
||||
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7016 - Could not find a declaration file for module '@webrecorder/wabac/src/loaders'. 'node_modules/@webrecorder/wabac/src/loaders.js' implicitly has an 'any' type.
|
||||
import { CollectionLoader } from "@webrecorder/wabac/src/loaders";
|
||||
import { type IpcRendererEvent } from "electron";
|
||||
|
||||
@@ -12,11 +13,15 @@ const dbs = {};
|
||||
const loader = new CollectionLoader();
|
||||
|
||||
async function getColl(name: string) {
|
||||
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
|
||||
if (!dbs[name]) {
|
||||
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
|
||||
dbs[name] = await loader.loadColl(name);
|
||||
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
|
||||
await dbs[name].initing;
|
||||
}
|
||||
|
||||
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return dbs[name];
|
||||
|
||||
Reference in New Issue
Block a user