Add linter for JS files with basic recommended rules:

- Add Github Action.
- Fix JS files to match rules; mostly `globals` and `exported`.
This commit is contained in:
Fabien Basmaison
2021-03-31 17:07:28 +02:00
parent 40c7bde7ec
commit 53f03457cc
8 changed files with 376 additions and 11 deletions

View File

@ -1,4 +1,4 @@
// Toggle all checkboxes.
/* exported toggleAllCheckboxes */
/**
* Toggle all descendant checkboxes of a target.

View File

@ -1,3 +1,6 @@
/* exported updateDisplay */
/* globals addRemoveClass */
// set javascript listeners
function updateDisplay(e) {
// used in set reading goal

View File

@ -1,3 +1,5 @@
/* globals setDisplay TabGroup toggleAllCheckboxes updateDisplay */
// set up javascript listeners
window.onload = function() {
// buttons that display or hide content
@ -93,7 +95,7 @@ function toggleAction(e) {
// show/hide container
var container = document.getElementById('hide-' + targetId);
if (!!container) {
if (container) {
addRemoveClass(container, 'hidden', pressed);
}

View File

@ -1,3 +1,5 @@
/* exported TabGroup */
/*
* The content below is licensed according to the W3C Software License at
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document