[assets] Add rules to ESLint:

- Fix long line.
- Enforce a few stylistic habits:

    - Avoid some potential dangerous constructs.
    - `arrow-spacing`: Use at least one space around arrows.
    - `keyword-spacing`: Use at least one space around keywords (if, else, for…).
    - `no-multiple-empty-lines`: Only use one empty line between code.
	- `no-var`: Use `let` or `const` instead of `var`:
    - `padded-blocks`: Do not pad blocks.
    - `padding-line-between-statements`: Use empty lines between some statements.
    - `space-before-blocks`: Use at least one space before the opening brace of a block.
This commit is contained in:
Fabien Basmaison
2021-04-06 10:42:52 +02:00
parent 991d897ac7
commit 70c652d565
3 changed files with 105 additions and 23 deletions

View File

@ -15,8 +15,9 @@ let LocalStorageTools = new class {
// set javascript listeners
updateDisplay(e) {
// used in set reading goal
var key = e.target.getAttribute('data-id');
var value = e.target.getAttribute('data-value');
let key = e.target.getAttribute('data-id');
let value = e.target.getAttribute('data-value');
window.localStorage.setItem(key, value);
document.querySelectorAll('[data-hide="' + key + '"]')
@ -25,8 +26,9 @@ let LocalStorageTools = new class {
setDisplay(el) {
// used in set reading goal
var key = el.getAttribute('data-hide');
var value = window.localStorage.getItem(key);
let key = el.getAttribute('data-hide');
let value = window.localStorage.getItem(key);
BookWyrm.addRemoveClass(el, 'hidden', value);
}
}