manually fix remaining lint errors

This commit is contained in:
Kevin Gibbons 2022-12-02 18:57:04 -08:00
parent ee7da0e726
commit 9c535d27e6
4 changed files with 15 additions and 9 deletions

View File

@ -7,6 +7,10 @@ module.exports = {
env: {
browser: true,
},
globals: {
browser: 'readonly',
chrome: 'readonly',
},
rules: {
strict: ['error', 'global'],
'no-unused-vars': ['error', { vars: 'local' }],

View File

@ -2,6 +2,8 @@
extension background script listening for events
*/
'use strict';
console.log('running background.js');
let browserType = getBrowser();

View File

@ -2,6 +2,8 @@
Loaded into popup index.html
*/
'use strict';
let browserType = getBrowser();
// boilerplate to dedect browser type api
@ -124,7 +126,7 @@ function setCookieState() {
// change status icon based on connection status
function setStatusIcon(connected) {
let statusIcon = document.getElementById('status-icon');
if (connected == true) {
if (connected) {
statusIcon.innerHTML = '☑';
statusIcon.style.color = 'green';
} else {
@ -161,10 +163,6 @@ document.addEventListener('DOMContentLoaded', async () => {
setCookieState();
}
function onError(error) {
console.log(`Error: ${error}`);
}
browserType.storage.local.get('access', function (result) {
onGot(result);
});

View File

@ -2,6 +2,8 @@
content script running on youtube.com
*/
'use strict';
let browserType = getBrowser();
// boilerplate to dedect browser type api
@ -129,7 +131,7 @@ function buildSubLink(channelContainer) {
});
subLink.addEventListener('mouseover', e => {
let subText;
if (window.location.pathname == '/watch') {
if (window.location.pathname === '/watch') {
let currentLocation = window.location.href;
subText = currentLocation;
} else {
@ -165,7 +167,7 @@ function buildDlLink(channelContainer) {
});
dlLink.addEventListener('mouseover', e => {
let subText;
if (window.location.pathname == '/watch') {
if (window.location.pathname === '/watch') {
let currentLocation = window.location.href;
subText = currentLocation;
} else {
@ -231,7 +233,7 @@ function buildVideoButton(thumbContainer) {
let videoTitle = thumbContainer.href;
e.target.title = 'TA download: ' + videoTitle;
});
dlButton.addEventListener('mouseout', e => {
dlButton.addEventListener('mouseout', () => {
Object.assign(dlButton.style, {
opacity: 0,
});
@ -321,7 +323,7 @@ function buttonError(button) {
buttonSpan.style.color = 'red';
button.style.opacity = 1;
button.addEventListener('mouseout', e => {
button.addEventListener('mouseout', () => {
Object.assign(button.style, {
opacity: 1,
});