Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint package.json files #3368

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
modules/default/calendar/vendor/*
modules/*
!modules/default/
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
"rules": {
"@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 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.js
.eslintignore
.prettierignore
/config
/coverage
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _This release is scheduled to be released on 2024-04-01._
### Added

- 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

Expand Down
2 changes: 2 additions & 0 deletions fonts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions fonts/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "magicmirror-fonts",
"description": "Package for fonts use by MagicMirror² Core.",
"repository": {
"type": "git",
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
},
"version": "1.0.0",
"description": "Package for fonts use by MagicMirror² core.",
"repository": "MagicMirrorOrg/MagicMirror",
"license": "MIT",
"bugs": {
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
Expand Down
119 changes: 119 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@
"test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit",
"test:unit": "NODE_ENV=test jest --selectProjects unit",
"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:calendar": "node ./modules/default/calendar/debug.js",
"config:check": "node js/check_config.js",
"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:staged": "lint-staged",
"prepare": "[ -f node_modules/.bin/husky ] && husky install || echo no husky installed."
},
"repository": {
"type": "git",
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
},
"repository": "MagicMirrorOrg/MagicMirror",
"keywords": [
"magic mirror",
"magicmirror",
Expand All @@ -53,6 +50,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-plugin-package-json": "^0.10.0",
"eslint-plugin-unicorn": "^50.0.1",
"express-basic-auth": "^1.2.1",
"husky": "^8.0.3",
Expand Down
2 changes: 2 additions & 0 deletions vendor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions vendor/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "magicmirror-vendors",
"description": "Package for vendors use by MagicMirror² Core.",
"repository": {
"type": "git",
"url": "git+https://github.com/MagicMirrorOrg/MagicMirror.git"
},
"version": "1.0.0",
"description": "Package for vendors use by MagicMirror² core.",
"repository": "MagicMirrorOrg/MagicMirror",
"license": "MIT",
"bugs": {
"url": "https://github.com/MagicMirrorOrg/MagicMirror/issues"
Expand Down