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:
Emma Segal-Grossman
2024-03-07 20:12:50 -05:00
committed by GitHub
parent 57123e8a63
commit 40d84f3383
21 changed files with 315 additions and 37 deletions
+10
View File
@@ -31,6 +31,8 @@ class GDrive extends LitElement {
if (changedProperties.has("sourceUrl")) {
this.error = false;
this.state = "trypublic";
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.tryPublicAccess().then((result) => {
if (!result) {
this.state = "tryauto";
@@ -67,6 +69,8 @@ class GDrive extends LitElement {
try {
const abort = new AbortController();
const signal = abort.signal;
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
resp = await fetch(publicUrl, { signal });
abort.abort();
if (resp.status != 200) {
@@ -99,6 +103,8 @@ class GDrive extends LitElement {
this.state = "trymanual";
}
} else {
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.authed(response);
}
});
@@ -107,6 +113,8 @@ class GDrive extends LitElement {
onClickAuth() {
this.gauth("select_account", (response) => {
if (!response.error) {
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.authed(response);
}
});
@@ -201,6 +209,8 @@ class GDrive extends LitElement {
response_type: "token",
prompt,
},
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
callback,
);
});