Skip to content

Commit

Permalink
strict syntax refine
Browse files Browse the repository at this point in the history
  • Loading branch information
iclaud committed Nov 25, 2023
1 parent b72f02e commit 3530b08
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions xExtension-ColorfulList/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ function monitorEntry(monitorCallback) {
const callback = function (mutationsList, observer) {
for (const mutation of mutationsList) {
if (mutation.type === 'childList') {
monitorCallback(mutationsList);
}
}
monitorCallback(mutationsList);

Check warning on line 15 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Expected indentation of 4 tabs but found 16 spaces
};

Check failure on line 16 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon
};

Check failure on line 17 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon
};
const observer = new MutationObserver(callback);
if(targetNode)
if(targetNode){

Check warning on line 20 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Expected indentation of 1 tab but found 4 spaces

Check failure on line 20 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Expected space(s) after "if"

Check failure on line 20 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Missing space before opening brace
observer.observe(targetNode, config);

Check failure on line 21 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Mixed spaces and tabs
}
};

Check warning on line 22 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Expected indentation of 1 tab but found 4 spaces

Check failure on line 22 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon
};

Check failure on line 23 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon

function colorize() {
const entry = document.querySelectorAll('.flux_header');
entry.forEach((e, i) => {
const cl = stringToColour(e.querySelector('.website').textContent) + '12';
e.style.background = cl;
});
}
};

Check failure on line 31 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon

const stringToColour = (str) => {
let hash = 0;
Expand All @@ -38,6 +39,6 @@ const stringToColour = (str) => {
for (let i = 0; i < 3; i++) {
const value = (hash >> (i * 8)) & 0xff;
color += value.toString(16).padStart(2, '0');
}
};

Check failure on line 42 in xExtension-ColorfulList/static/script.js

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon
return color;
};

0 comments on commit 3530b08

Please sign in to comment.