From 2b840ec462a64233ba132020b03541fe72147d05 Mon Sep 17 00:00:00 2001 From: Dennis Twardowsky Date: Sun, 8 Feb 2026 16:20:31 +0100 Subject: [PATCH] Update template and workflow files from Homebridge template plugin --- .eslintrc | 38 ----------------------- .github/ISSUE_TEMPLATE/bug-report.md | 2 +- .github/ISSUE_TEMPLATE/feature-request.md | 3 +- .github/ISSUE_TEMPLATE/support-request.md | 2 +- .github/workflows/build.yml | 20 +++++++----- .npmignore | 4 ++- .vscode/settings.json | 6 ++-- README.md | 2 +- eslist.config.js | 35 +++++++++++++++++++++ 9 files changed, 59 insertions(+), 53 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslist.config.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index ba9b8ef..0000000 --- a/.eslintrc +++ /dev/null @@ -1,38 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin - ], - "parserOptions": { - "ecmaVersion": 2018, - "sourceType": "module" - }, - "ignorePatterns": [ - "dist" - ], - "rules": { - "quotes": ["warn", "single"], - "indent": ["warn", 2, { "SwitchCase": 1 }], - "semi": ["off"], - "comma-dangle": ["warn", "always-multiline"], - "dot-notation": "off", - "eqeqeq": "warn", - "curly": ["warn", "all"], - "brace-style": ["warn"], - "prefer-arrow-callback": ["warn"], - "max-len": ["warn", 140], - "no-console": ["warn"], // use the provided Homebridge log method instead - "no-non-null-assertion": ["off"], - "comma-spacing": ["error"], - "no-multi-spaces": ["warn", { "ignoreEOLComments": true }], - "no-trailing-spaces": ["warn"], - "lines-between-class-members": ["warn", "always", {"exceptAfterSingleLine": true}], - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/semi": ["warn"], - "@typescript-eslint/member-delimiter-style": ["warn"] - } -} diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index fd51059..773cbc4 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -41,4 +41,4 @@ Show your Homebridge config.json here, remove any sensitive information. * **NPM Version**: * **Operating System**: - + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index f974b3b..97e14f0 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -19,5 +19,4 @@ assignees: '' **Additional context:** - - + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/support-request.md b/.github/ISSUE_TEMPLATE/support-request.md index c64c5ff..d270ece 100644 --- a/.github/ISSUE_TEMPLATE/support-request.md +++ b/.github/ISSUE_TEMPLATE/support-request.md @@ -35,4 +35,4 @@ Show your Homebridge config.json here, remove any sensitive information. * **NPM Version**: * **Operating System**: - + \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e307356..3f44a15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,15 +7,15 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - # the Node.js versions to build on - node-version: [12.x, 13.x, 14.x, 15.x, 16.x] + node-version: [20.x, 22.x, 24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} @@ -27,5 +27,11 @@ jobs: - name: Build the project run: npm run build - env: - CI: true + + - name: List, audit, fix outdated dependencies and build again + run: | + npm list --outdated + npm audit || true # ignore failures + npm audit fix || true + npm list --outdated + npm run build \ No newline at end of file diff --git a/.npmignore b/.npmignore index 427902d..d546053 100644 --- a/.npmignore +++ b/.npmignore @@ -10,7 +10,7 @@ src .github # eslint -.eslintrc +eslint.config.js # typescript tsconfig.json @@ -135,3 +135,5 @@ web_modules/ .yarn/unplugged .yarn/build-state.yml .pnp.* + +test/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 31b20d1..80ee8cc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,10 @@ { "files.eol": "\n", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, - "editor.rulers": [ 140 ], + "editor.rulers": [ + 140 + ], "eslint.enable": true } \ No newline at end of file diff --git a/README.md b/README.md index acef2e4..015aabb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

+

Homebridge

diff --git a/eslist.config.js b/eslist.config.js new file mode 100644 index 0000000..32d64d5 --- /dev/null +++ b/eslist.config.js @@ -0,0 +1,35 @@ +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { + ignores: ['dist/**'], + }, + { + rules: { + 'quotes': ['error', 'single'], + 'indent': ['error', 2, { 'SwitchCase': 0 }], + 'linebreak-style': ['error', 'unix'], + 'semi': ['error', 'always'], + 'comma-dangle': ['error', 'always-multiline'], + 'dot-notation': 'error', + 'eqeqeq': ['error', 'smart'], + 'curly': ['error', 'all'], + 'brace-style': ['error'], + 'prefer-arrow-callback': 'warn', + 'max-len': ['warn', 160], + 'object-curly-spacing': ['error', 'always'], + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': ['error', { 'classes': false, 'enums': false }], + '@typescript-eslint/no-unused-vars': ['error', { 'caughtErrors': 'none' }], + }, + }, + { + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + }, + }, + eslint.configs.recommended, + ...tseslint.configs.recommended, +); \ No newline at end of file