Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Git runs hooks from the repository root, and core.hooksPath is repo-wide.
# This is a Go + JS monorepo, so only run the frontend checks when the frontend
# dependencies are installed — this keeps backend-only commits from being blocked.
[ -d frontend/node_modules ] || exit 0

cd frontend && npx lint-staged
13 changes: 6 additions & 7 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,12 @@
"url": "git+https://github.com/mendersoftware/gui.git"
},
"type": "module",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"post-commit": "sh ${MENDER_TESTING}/check_commits.sh"
}
},
"scripts": {
"prepare": "husky",
"build": "rspack --mode production",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"format": "prettier --write \"src/js/**/*.{js,ts,jsx,tsx,less}\"",
"format:check": "prettier --check \"src/js/**/*.{js,ts,jsx,tsx,less}\"",
Comment on lines +136 to 137

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that just aligns with the format check here - works for me

"serve": "rspack serve --mode development",
"serve:mocked": "MOCKS=true rspack serve --mode development",
Expand All @@ -154,6 +150,9 @@
},
"homepage": "https://mender.io/",
"lint-staged": {
"*.js": "eslint --cache --fix"
"*.{js,ts,jsx,tsx}": [
"eslint --cache --fix",
"prettier --write"
]
}
}