1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Linter updates and fixes (#1604)

This commit is contained in:
Matt Gibson
2021-02-10 09:40:15 -06:00
committed by GitHub
parent dae739bc17
commit 1868b99d17
17 changed files with 73 additions and 56 deletions

View File

@@ -1,4 +1,4 @@
document.addEventListener('DOMContentLoaded', (event) => {
document.addEventListener('DOMContentLoaded', event => {
let pageHref: string = null;
let filledThisHref = false;
let delayFillTimeout: number;

View File

@@ -1,4 +1,4 @@
document.addEventListener('DOMContentLoaded', (event) => {
document.addEventListener('DOMContentLoaded', event => {
if (window.location.hostname.indexOf('vault.bitwarden.com') > -1) {
return;
}
@@ -83,7 +83,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
function observeDom() {
const bodies = document.querySelectorAll('body');
if (bodies && bodies.length > 0) {
observer = new MutationObserver((mutations) => {
observer = new MutationObserver(mutations => {
if (mutations == null || mutations.length === 0 || pageHref !== window.location.href) {
return;
}
@@ -333,7 +333,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
} else {
const buttonText = getButtonText(getSubmitButton(form, changePasswordButtonNames));
const matches = Array.from(changePasswordButtonContainsNames)
.filter((n) => buttonText.indexOf(n) > -1);
.filter(n => buttonText.indexOf(n) > -1);
if (matches.length > 0) {
curPass = passwords[0];
newPass = passwords[1];
@@ -379,7 +379,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
const possibleSubmitButtons = Array.from(wrappingEl.querySelectorAll('a, span, button[type="button"], ' +
'input[type="button"], button:not([type])')) as HTMLElement[];
let typelessButton: HTMLElement = null;
possibleSubmitButtons.forEach((button) => {
possibleSubmitButtons.forEach(button => {
if (submitButton != null || button == null || button.tagName == null) {
return;
}

View File

@@ -1,6 +1,6 @@
import * as Mousetrap from 'mousetrap';
document.addEventListener('DOMContentLoaded', (event) => {
document.addEventListener('DOMContentLoaded', event => {
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
navigator.userAgent.indexOf('Chrome') === -1;
const isVivaldi = !isSafari && navigator.userAgent.indexOf(' Vivaldi/') !== -1;

View File

@@ -1,4 +1,4 @@
window.addEventListener('message', (event) => {
window.addEventListener('message', event => {
if (event.source !== window)
return;