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:
@@ -21,6 +21,8 @@ export class Chooser extends LitElement {
|
||||
droppedFile: FileWithPath | null = null;
|
||||
|
||||
@property({ type: Boolean })
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
hasNativeFS = !!window.showOpenFilePicker && !IS_APP;
|
||||
|
||||
@property({ type: Object })
|
||||
@@ -60,6 +62,8 @@ export class Chooser extends LitElement {
|
||||
.flat(2);
|
||||
|
||||
const fileHasAllowedExtension = allowedFileExtensions.some(
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
(extension) => this.droppedFile?.name.endsWith(extension),
|
||||
);
|
||||
|
||||
@@ -77,6 +81,8 @@ export class Chooser extends LitElement {
|
||||
if (event.currentTarget.files.length === 0) {
|
||||
return;
|
||||
}
|
||||
// TODO: Fix this the next time the file is edited.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
this.setFile(event.currentTarget.files[0]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user