From 41345920a32778ce08305339e210138840d7c56b Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:11:53 +0100 Subject: [PATCH] Updated `eslint` and use new code style --- .eslintrc.cjs | 26 - .github/FUNDING.yml | 2 +- .github/ISSUE_TEMPLATE.md | 12 +- .github/ISSUE_TEMPLATE/feature-request.md | 8 - .github/ISSUE_TEMPLATE/feedback.md | 1 - .github/ISSUE_TEMPLATE/model-request.md | 8 - .github/ISSUE_TEMPLATE/new-issue.md | 14 +- .github/dependabot.yml | 6 +- .github/workflows/codeql-analysis.yml | 60 +- CHANGELOG.md | 6 + README.md | 8 +- eslint.config.js | 14 + lib/connection/aws.js | 113 +- lib/connection/ble.js | 151 +- lib/connection/http.js | 159 +- lib/connection/lan.js | 178 +- lib/device/cooler-single.js | 212 +- lib/device/dehumidifier-H7150.js | 92 +- lib/device/dehumidifier-H7151.js | 92 +- lib/device/diffuser-H7161.js | 72 +- lib/device/diffuser-H7162.js | 72 +- lib/device/fan.js | 186 +- lib/device/heater-single.js | 212 +- lib/device/heater1a.js | 191 +- lib/device/heater1b.js | 327 +- lib/device/heater2.js | 530 +- lib/device/humidifier-H7140.js | 138 +- lib/device/humidifier-H7141.js | 136 +- lib/device/humidifier-H7142.js | 336 +- lib/device/humidifier-H7143.js | 92 +- lib/device/humidifier-H7160.js | 300 +- lib/device/ice-maker-H7162.js | 18 +- lib/device/index.js | 84 +- lib/device/kettle.js | 172 +- lib/device/light-switch.js | 58 +- lib/device/light.js | 406 +- lib/device/outlet-double.js | 88 +- lib/device/outlet-single.js | 66 +- lib/device/outlet-triple.js | 112 +- lib/device/purifier-H7120.js | 184 +- lib/device/purifier-H7121.js | 184 +- lib/device/purifier-H7122.js | 278 +- lib/device/purifier-H7123.js | 236 +- lib/device/purifier-H7126.js | 184 +- lib/device/purifier-single.js | 72 +- lib/device/sensor-button.js | 18 +- lib/device/sensor-contact.js | 18 +- lib/device/sensor-leak.js | 60 +- lib/device/sensor-monitor.js | 136 +- lib/device/sensor-thermo.js | 98 +- lib/device/sensor-thermo4.js | 40 +- lib/device/switch-double.js | 88 +- lib/device/switch-single.js | 66 +- lib/device/switch-triple.js | 112 +- lib/device/tap-single.js | 74 +- lib/device/template.js | 18 +- lib/device/tv-single.js | 58 +- lib/device/valve-single.js | 118 +- lib/fakegato/fakegato-history.js | 604 +- lib/fakegato/fakegato-storage.js | 91 +- lib/fakegato/fakegato-timer.js | 83 +- lib/fakegato/uuid.js | 32 +- lib/homebridge-ui/server.js | 8 +- lib/index.js | 10 +- lib/platform.js | 1289 +++-- lib/utils/colour.js | 118 +- lib/utils/constants.js | 2 +- lib/utils/custom-chars.js | 244 +- lib/utils/eve-chars.js | 22 +- lib/utils/functions.js | 145 +- lib/utils/lang-en.js | 4 +- package-lock.json | 6336 ++++++++++++++------- package.json | 65 +- 73 files changed, 8959 insertions(+), 6894 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 9effb885..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - env: { - es2022: true, - node: true, - }, - extends: ['airbnb-base'], - parserOptions: { - ecmaVersion: 13, - sourceType: 'module', - }, - plugins: ['import', 'import-newlines', 'sort-exports'], - rules: { - camelcase: 'off', - 'import/extensions': ['error', { js: 'always', json: 'always' }], - 'import/order': ['warn', { alphabetize: { order: 'asc' } }], - 'import-newlines/enforce': ['error', 3], - indent: ['error', 2, { SwitchCase: 1 }], - 'max-len': 'off', - 'new-cap': 0, - quotes: ['error', 'single'], - 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 1, maxEOF: 0 }], - 'no-param-reassign': 0, - 'sort-exports/sort-exports': ['warn', { sortDir: 'asc' }], - 'sort-imports': ['warn', { ignoreDeclarationSort: true }], - }, -}; diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index aa62079e..3a1e935f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ github: bwp91 patreon: bwp91 ko_fi: bwp91 -custom: ["https://www.paypal.me/BenPotter"] +custom: ['https://www.paypal.me/BenPotter'] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index ad76f08f..9b0c3361 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -6,25 +6,15 @@ ### What issue do you have? Please be as thorough and explicit as possible. - - ### Details of your setup. -* Do you use Homebridge (with config-ui?) or HOOBS? - - +* Do you use Homebridge (with config-ui?) or HOOBS? * Which version of Homebridge/HOOBS do you have? - - * Which version of this plugin (homebridge-govee) do you have? Has the issue started since upgrading from a previous version? - - * Which Govee devices do you have that are causing issues? Please include product models if applicable. - - ### Please paste any relevant logs below.