mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-23 05:20:03 +00:00
Lint package.json files (#3368)
Notable changes in this context: - simplification of the ESLint calls - there is no longer a combination of two file/directory lists (one in `package.json` and one in `.eslintignore`) - removal of a non-existent path from the `.eslintignore` - use shorthand declaration for GitHub repository Normally the new plugin would also sort the scripts in the package.json alphabetically, but I think the current order is fine, so I deactivated it. Is it overkill to introduce a linter plugin just for the `package.json` files? In other projects I have seen that such internal changes were marked with "chore" in the changelog. That's what I've done here. These chore changes are less interesting for "normal" users. Please feel free to give me feedback.
This commit is contained in:
committed by
GitHub
parent
f88b92fb1f
commit
b0161fe011
@@ -1 +1,2 @@
|
|||||||
modules/default/calendar/vendor/*
|
modules/*
|
||||||
|
!modules/default/
|
@@ -79,6 +79,15 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"@stylistic/quotes": "off"
|
"@stylistic/quotes": "off"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extends": ["plugin:package-json/recommended"],
|
||||||
|
"files": ["package.json"],
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"plugins": ["package-json"],
|
||||||
|
"rules": {
|
||||||
|
"package-json/sort-collections": ["error", ["devDependencies", "dependencies", "peerDependencies", "config"]]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
*.js
|
*.js
|
||||||
|
.eslintignore
|
||||||
.prettierignore
|
.prettierignore
|
||||||
/config
|
/config
|
||||||
/coverage
|
/coverage
|
||||||
|
@@ -12,6 +12,7 @@ _This release is scheduled to be released on 2024-04-01._
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Output of system information to the console for troubleshooting (#3328 and #3337), ignore errors under aarch64
|
- Output of system information to the console for troubleshooting (#3328 and #3337), ignore errors under aarch64
|
||||||
|
- [chore] Add `eslint-plugin-package-json` to lint the `package.json` files
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
|
2
fonts/package-lock.json
generated
2
fonts/package-lock.json
generated
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror-fonts",
|
"name": "magicmirror-fonts",
|
||||||
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "magicmirror-fonts",
|
"name": "magicmirror-fonts",
|
||||||
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.0.8",
|
"@fontsource/roboto": "^5.0.8",
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror-fonts",
|
"name": "magicmirror-fonts",
|
||||||
"description": "Package for fonts use by MagicMirror² Core.",
|
"version": "1.0.0",
|
||||||
"repository": {
|
"description": "Package for fonts use by MagicMirror² core.",
|
||||||
"type": "git",
|
"repository": "MagicMirrorOrg/MagicMirror",
|
||||||
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
|
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
|
||||||
|
119
package-lock.json
generated
119
package-lock.json
generated
@@ -32,6 +32,7 @@
|
|||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-jest": "^27.6.3",
|
"eslint-plugin-jest": "^27.6.3",
|
||||||
"eslint-plugin-jsdoc": "^48.0.2",
|
"eslint-plugin-jsdoc": "^48.0.2",
|
||||||
|
"eslint-plugin-package-json": "^0.10.0",
|
||||||
"eslint-plugin-unicorn": "^50.0.1",
|
"eslint-plugin-unicorn": "^50.0.1",
|
||||||
"express-basic-auth": "^1.2.1",
|
"express-basic-auth": "^1.2.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
@@ -2055,6 +2056,16 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/glob": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/minimatch": "*",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/graceful-fs": {
|
"node_modules/@types/graceful-fs": {
|
||||||
"version": "4.1.9",
|
"version": "4.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
|
||||||
@@ -2115,6 +2126,12 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/minimatch": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "18.19.7",
|
"version": "18.19.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.7.tgz",
|
||||||
@@ -2973,6 +2990,15 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/builtins": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"semver": "^7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/bytes": {
|
"node_modules/bytes": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||||
@@ -3765,6 +3791,15 @@
|
|||||||
"npm": "1.2.8000 || >= 1.4.16"
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/detect-indent": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/detect-newline": {
|
"node_modules/detect-newline": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
|
||||||
@@ -4570,6 +4605,25 @@
|
|||||||
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
|
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint-plugin-package-json": {
|
||||||
|
"version": "0.10.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-package-json/-/eslint-plugin-package-json-0.10.0.tgz",
|
||||||
|
"integrity": "sha512-vUEfGptdpaEw0DTzN8Yl4cjZ2XZosuzAbZ+kOKJN+tJRe2hZDogesMhNYT8FI26QZ1rYUnfQ0wwzBTjswGr04g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"package-json-validator": "^0.6.3",
|
||||||
|
"semver": "^7.5.4",
|
||||||
|
"sort-package-json": "^1.57.0",
|
||||||
|
"validate-npm-package-name": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": ">=8.0.0",
|
||||||
|
"jsonc-eslint-parser": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint-plugin-unicorn": {
|
"node_modules/eslint-plugin-unicorn": {
|
||||||
"version": "50.0.1",
|
"version": "50.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-50.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-50.0.1.tgz",
|
||||||
@@ -6114,6 +6168,15 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-plain-obj": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-plain-object": {
|
"node_modules/is-plain-object": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||||
@@ -7027,6 +7090,25 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jsonc-eslint-parser": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonc-eslint-parser/-/jsonc-eslint-parser-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==",
|
||||||
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"acorn": "^8.5.0",
|
||||||
|
"eslint-visitor-keys": "^3.0.0",
|
||||||
|
"espree": "^9.0.0",
|
||||||
|
"semver": "^7.3.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ota-meshi"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsonfile": {
|
"node_modules/jsonfile": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||||
@@ -8075,6 +8157,31 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/optimist": {
|
||||||
|
"version": "0.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
||||||
|
"integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"minimist": "~0.0.1",
|
||||||
|
"wordwrap": "~0.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/optimist/node_modules/minimist": {
|
||||||
|
"version": "0.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
|
||||||
|
"integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/optimist/node_modules/wordwrap": {
|
||||||
|
"version": "0.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
|
||||||
|
"integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/optionator": {
|
"node_modules/optionator": {
|
||||||
"version": "0.9.3",
|
"version": "0.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
|
||||||
@@ -11082,6 +11189,18 @@
|
|||||||
"spdx-license-ids": "^3.0.0"
|
"spdx-license-ids": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/validate-npm-package-name": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"builtins": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vary": {
|
"node_modules/vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
10
package.json
10
package.json
@@ -18,20 +18,17 @@
|
|||||||
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
|
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
|
||||||
"test:unit": "NODE_ENV=test jest --selectProjects unit",
|
"test:unit": "NODE_ENV=test jest --selectProjects unit",
|
||||||
"test:prettier": "prettier . --check",
|
"test:prettier": "prettier . --check",
|
||||||
"test:js": "eslint 'js/**/*.js' 'modules/default/**/*.js' 'clientonly/*.js' 'serveronly/*.js' 'translations/*.js' 'vendor/*.js' 'tests/**/*.js' 'config/*'",
|
"test:js": "eslint .",
|
||||||
"test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json",
|
"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:calendar": "node ./modules/default/calendar/debug.js",
|
||||||
"config:check": "node js/check_config.js",
|
"config:check": "node js/check_config.js",
|
||||||
"lint:prettier": "prettier . --write",
|
"lint:prettier": "prettier . --write",
|
||||||
"lint:js": "eslint 'js/**/*.js' 'modules/default/**/*.js' 'clientonly/*.js' 'serveronly/*.js' 'translations/*.js' 'vendor/*.js' 'tests/**/*.js' 'config/*' --fix",
|
"lint:js": "eslint . --fix",
|
||||||
"lint:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json --fix",
|
"lint:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json --fix",
|
||||||
"lint:staged": "lint-staged",
|
"lint:staged": "lint-staged",
|
||||||
"prepare": "[ -f node_modules/.bin/husky ] && husky install || echo no husky installed."
|
"prepare": "[ -f node_modules/.bin/husky ] && husky install || echo no husky installed."
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": "MagicMirrorOrg/MagicMirror",
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"magic mirror",
|
"magic mirror",
|
||||||
"magicmirror",
|
"magicmirror",
|
||||||
@@ -53,6 +50,7 @@
|
|||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-jest": "^27.6.3",
|
"eslint-plugin-jest": "^27.6.3",
|
||||||
"eslint-plugin-jsdoc": "^48.0.2",
|
"eslint-plugin-jsdoc": "^48.0.2",
|
||||||
|
"eslint-plugin-package-json": "^0.10.0",
|
||||||
"eslint-plugin-unicorn": "^50.0.1",
|
"eslint-plugin-unicorn": "^50.0.1",
|
||||||
"express-basic-auth": "^1.2.1",
|
"express-basic-auth": "^1.2.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
|
2
vendor/package-lock.json
generated
vendored
2
vendor/package-lock.json
generated
vendored
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror-vendors",
|
"name": "magicmirror-vendors",
|
||||||
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "magicmirror-vendors",
|
"name": "magicmirror-vendors",
|
||||||
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^6.5.1",
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
||||||
|
8
vendor/package.json
vendored
8
vendor/package.json
vendored
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror-vendors",
|
"name": "magicmirror-vendors",
|
||||||
"description": "Package for vendors use by MagicMirror² Core.",
|
"version": "1.0.0",
|
||||||
"repository": {
|
"description": "Package for vendors use by MagicMirror² core.",
|
||||||
"type": "git",
|
"repository": "MagicMirrorOrg/MagicMirror",
|
||||||
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
|
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
|
||||||
|
Reference in New Issue
Block a user