From 74d2eee70c4f6084e92dadc70a2e246e396d3392 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:02:07 +0100 Subject: [PATCH 1/3] Reactivate eslint-plugin-package-json --- eslint.config.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 54aad11a81..496f5aa5f9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,12 +1,14 @@ import eslintPluginImport from "eslint-plugin-import"; import eslintPluginJest from "eslint-plugin-jest"; import eslintPluginJs from "@eslint/js"; +import eslintPluginPackageJson from "eslint-plugin-package-json/configs/recommended"; import eslintPluginStylistic from "@stylistic/eslint-plugin"; import globals from "globals"; const config = [ eslintPluginJs.configs.recommended, eslintPluginImport.flatConfigs.recommended, + eslintPluginPackageJson, { files: ["**/*.js"], languageOptions: { @@ -106,6 +108,7 @@ const config = [ "@stylistic/quote-props": ["error", "as-needed"], "func-style": "off", "import/namespace": "off", + "import/no-unresolved": "off", "max-lines-per-function": ["error", 100], "no-magic-numbers": "off", "one-var": "off", @@ -118,6 +121,12 @@ const config = [ "@stylistic/quotes": "off" } }, + { + files: ["package.json"], + rules: { + "package-json/sort-collections": "off" + } + }, { ignores: ["config/**", "modules/**/*", "!modules/default/**", "js/positions.js"] } From b5c244f0e9c3d1cafd6dbe9186a6c06a224ee465 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:03:25 +0100 Subject: [PATCH 2/3] Enable rule "package-json/sort-collections" and sort scripts --- eslint.config.mjs | 6 ------ package.json | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 496f5aa5f9..e8800a5144 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -121,12 +121,6 @@ const config = [ "@stylistic/quotes": "off" } }, - { - files: ["package.json"], - rules: { - "package-json/sort-collections": "off" - } - }, { ignores: ["config/**", "modules/**/*", "!modules/default/**", "js/positions.js"] } diff --git a/package.json b/package.json index 7bce12efcd..372b3196a4 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,18 @@ ], "main": "js/electron.js", "scripts": { + "config:check": "node js/check_config.js", + "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", + "install-mm": "npm install --no-audit --no-fund --no-update-notifier --only=prod --omit=dev", + "install-mm:dev": "npm install --no-audit --no-fund --no-update-notifier", + "install-vendor": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", + "lint:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json --fix", + "lint:js": "eslint . --fix", + "lint:prettier": "prettier . --write", + "lint:staged": "lint-staged", + "postinstall": "npm run install-vendor && npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"", + "prepare": "[ -f node_modules/.bin/husky ] && husky || echo no husky installed.", + "server": "node ./serveronly", "start": "npm run start:x11", "start:dev": "npm run start -- dev", "start:wayland": "WAYLAND_DISPLAY=\"${WAYLAND_DISPLAY:=wayland-1}\" ./node_modules/.bin/electron js/electron.js --enable-features=UseOzonePlatform --ozone-platform=wayland", @@ -32,28 +44,16 @@ "start:windows:dev": "npm run start:windows -- dev", "start:x11": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js", "start:x11:dev": "npm run start -- dev", - "server": "node ./serveronly", - "install-mm": "npm install --no-audit --no-fund --no-update-notifier --only=prod --omit=dev", - "install-mm:dev": "npm install --no-audit --no-fund --no-update-notifier", - "install-vendor": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", - "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", - "postinstall": "npm run install-vendor && npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"", "test": "NODE_ENV=test jest -i --forceExit", + "test:calendar": "node ./modules/default/calendar/debug.js", "test:coverage": "NODE_ENV=test jest --coverage -i --verbose false --forceExit", - "test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit", + "test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json", "test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit", - "test:unit": "NODE_ENV=test jest --selectProjects unit", - "test:prettier": "prettier . --check", + "test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit", "test:js": "eslint .", - "test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json", - "test:calendar": "node ./modules/default/calendar/debug.js", + "test:prettier": "prettier . --check", "test:spelling": "cspell . --gitignore", - "config:check": "node js/check_config.js", - "lint:prettier": "prettier . --write", - "lint:js": "eslint . --fix", - "lint:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json --fix", - "lint:staged": "lint-staged", - "prepare": "[ -f node_modules/.bin/husky ] && husky || echo no husky installed." + "test:unit": "NODE_ENV=test jest --selectProjects unit" }, "lint-staged": { "*": "prettier --write", From 4c2289da852d873f4ffe0332cdc6b23169b2916a Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:08:34 +0100 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f2416109..62d02f6179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,12 @@ _This release is scheduled to be released on 2025-01-01._ ### Added - [core] Add wayland and windows start options to `package.json` (#3594) -- [linter] re-added `eslint-plugin-import`now that it supports ESLint v9 (#3586) -- [docs] Added step for npm publishing in release process (#3595) -- [core] Add GitHub workflow to run spellcheck a few days before each release. +- [docs] Add step for npm publishing in release process (#3595) +- [core] Add GitHub workflow to run spellcheck a few days before each release (#3623) - [core] Add intest flag to index.html to pass to module js for test mode detection (needed by #3630) -- [compliments] add support for refreshing remote compliments file, and testcases +- [compliments] add support for refreshing remote compliments file, and testcases (#3630) +- [linter] Re-add `eslint-plugin-import`now that it supports ESLint v9 (#3586) +- [linter] Re-activate `eslint-plugin-package-json` to lint `package.json` ### Removed