diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100755 index 679590d5..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "env": { - "es6": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended" - ], - "rules": { - "indent": [ - "error", - 4, - { - "SwitchCase": 1 - } - ], - "no-console": "off", - "no-var": "error", - "no-unused-vars": "warn", - "no-trailing-spaces": "error", - "prefer-const": "warn", - "quotes": [ - "warn", - "single", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "semi": [ - "warn", - "always" - ], - "no-prototype-builtins": "off" - }, - "parserOptions": { - "ecmaVersion": 2019 - } -} diff --git a/README.md b/README.md index 31ef0c37..6133f79e 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,11 @@ You can thank the authors by these links: * to Arthur Rupp https://paypal.me/ArthurRupp ----------------------------------------------------------------------------------------------------- +## Changelog + +### UNRELEASED +* (lebrinkma) fix linter errors + ### 1.10.9 (2024-09-05) * (arteck) typo admin settings * (arteck) eslint config diff --git a/admin/adapter-settings.js b/admin/adapter-settings.js index e8beaf3b..5ba7c6c6 100644 --- a/admin/adapter-settings.js +++ b/admin/adapter-settings.js @@ -4,8 +4,8 @@ const parts = path.split('/'); parts.splice(-3); const socket = io.connect('/', { path: parts.join('/') + '/socket.io' }); -var query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, ''); -var args = {}; +const query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, ''); +const args = {}; let theme = null; // parse parameters @@ -14,7 +14,7 @@ query.trim().split('&').filter(function (t) { return t.trim(); }).forEach(functi if (!i && parts.length === 1 && !isNaN(parseInt(b, 10))) { args.instance = parseInt(b, 10); } - var name = parts[0]; + const name = parts[0]; args[name] = parts.length === 2 ? parts[1] : true; if (name === 'instance') { @@ -28,7 +28,7 @@ query.trim().split('&').filter(function (t) { return t.trim(); }).forEach(functi } }); -var instance = args.instance; +const instance = args.instance; let common = null; // common information of adapter const host = null; // host object on which the adapter runs @@ -96,23 +96,23 @@ function loadSettings(callback) { if (typeof load === 'undefined') { alert('Please implement save function in your admin/index.html'); } else { - const _query = query.split('&'); - for (var q = 0; q < _query.length; q++) { - if (_query[q].indexOf('react=') !== -1) { - $('.adapter-container').addClass('react-' + _query[q].substring(6)); - theme = 'react-' + _query[q].substring(6); + const _query = query.split('&'); + for (let q = 0; q < _query.length; q++) { + if (_query[q].indexOf('react=') !== -1) { + $('.adapter-container').addClass('react-' + _query[q].substring(6)); + theme = 'react-' + _query[q].substring(6); + } } - } - load(res.native, onChange); + load(res.native, onChange); } if (typeof callback === 'function') { callback(); } } else { - if (typeof callback === 'function') { - callback(); - } - alert('error loading settings for ' + _adapterInstance + '\n\n' + err); + if (typeof callback === 'function') { + callback(); + } + alert('error loading settings for ' + _adapterInstance + '\n\n' + err); } }); } @@ -152,7 +152,7 @@ function prepareTooltips() { link = 'https://github.com/ioBroker/ioBroker.' + common.name + '#' + id; } } - if (!link.match('^https?:\/\/')) { + if (!link.match('^https?:\/\/')) { //eslint-disable-line no-useless-escape if (common.readme) { link = common.readme + '#' + link; } else { @@ -207,9 +207,8 @@ function onChange(isChanged) { } function showMessage(message, title, icon) { - var $dialogMessage; // noinspection JSJQueryEfficiency - $dialogMessage = $('#dialog-message'); + let $dialogMessage = $('#dialog-message'); if (!$dialogMessage.length) { $('body').append( '