ESLint parity with the Browsertrix repo (#288)
This copies the rules from the Browsertrix repo, and uses [`suppress-eslint-errors`](https://www.npmjs.com/package/suppress-eslint-errors) to suppose the violations. I'll take a pass at cleaning this up at some point in the future, and let's do our best to address these in the future as we come across them :) This'll help ensure new code being added to this repo is held to the same standard as code in Browsertrix's frontend.
This commit is contained in:
@@ -27,6 +27,8 @@ export class SWManager {
|
||||
this.appName = newAppName;
|
||||
}
|
||||
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
||||
register() {
|
||||
let resolve, reject;
|
||||
|
||||
@@ -64,6 +66,8 @@ export class SWManager {
|
||||
};
|
||||
|
||||
// @ts-expect-error - TS2339 - Property 'scope' does not exist on type 'SWManager'. | TS2339 - Property 'name' does not exist on type 'SWManager'.
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
register(this.scope + this.name, {
|
||||
// @ts-expect-error - TS2339 - Property 'scope' does not exist on type 'SWManager'.
|
||||
registrationOptions: { scope: this.scope },
|
||||
@@ -105,6 +109,8 @@ export class SWManager {
|
||||
}
|
||||
|
||||
getSWErrorMsg() {
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (navigator.serviceWorker) {
|
||||
// must be loaded from a cross-origin (eg. subdomain)
|
||||
// @ts-expect-error - TS2339 - Property 'requireSubdomainIframe' does not exist on type 'SWManager'.
|
||||
|
||||
Reference in New Issue
Block a user