diff --git a/.eslintrc.json b/.eslintrc.json index a20ebd3..76653e5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,5 +9,7 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "rules": {} + "rules": { + "no-unused-vars": ["error", {"argsIgnorePattern": "^_"}] + } } diff --git a/radiomanifest.js b/radiomanifest.js index 66378cc..fdcb58e 100644 --- a/radiomanifest.js +++ b/radiomanifest.js @@ -178,7 +178,7 @@ class Radio { class RadioStreaming { constructor(sources) { this.sources = sources.sort( - (a, b) => this.getPriority(a) < this.getPriority(a), + (a, b) => this.getPriority(a) < this.getPriority(b), ); } @@ -254,7 +254,7 @@ class RadioStreaming { * @param {Object} options options. Currenly unused * @return {Radio} */ -async function get(siteurl, options) { +async function get(siteurl, _options) { let resp = await fetch(getManifestUrl(siteurl)); let text = await resp.text(); diff --git a/ui.js b/ui.js index 1d55ae4..ee25891 100644 --- a/ui.js +++ b/ui.js @@ -1,12 +1,14 @@ +/* global radiomanifest */ // const radiomanifest = require('radiomanifest.js') function updateNow(radio) { var box = document.querySelector("#now-info"); const show = radio.getSchedule().getNowShow(); + var showText; try { - var showText = show.getName() + "\nfeed: " + show.getWebsite(); + showText = show.getName() + "\nfeed: " + show.getWebsite(); } catch (e) { - var showText = String(show); + showText = String(show); } var text = radio.getName() + " - " + radio.getDescription() + " -- " + showText;