chore: Add eslint github check (#1067)

This commit is contained in:
Attila Kerekes
2022-12-11 17:44:37 +00:00
committed by GitHub
parent 5eb1f55b82
commit 3c9f361f5f
10 changed files with 135 additions and 234 deletions

View File

@@ -7,6 +7,7 @@ const APP_LOAD_URL = "appload";
* @param {array} errors
*/
const updateStatus = ({ item, errors }) => {
// eslint-disable-next-line no-console
console.log(item, errors);
let statusLine;
if (errors.length === 0) {
@@ -147,23 +148,24 @@ const readJSON = (file) =>
/**
*
* @param {Event} event
* @param {Blob} file
*/
const openFileForImport = (file) => {
clearStatus();
return readJSON(file)
.catch((error) => {
// eslint-disable-next-line no-console
console.error(error);
})
.then(importItems);
};
const fileInput = document.querySelector("input[name='import']");
const importButton = document.querySelectorAll(".import-button");
const importButtons = document.querySelectorAll(".import-button");
if (fileInput && importButton) {
importButton.forEach((importButton) => {
if (fileInput && importButtons) {
importButtons.forEach((importButton) => {
importButton.addEventListener("click", () => {
const file = fileInput.files[0];
if (!file) {