Skip to content

Commit

Permalink
Remove pre-commit hook (stolostron#2585)
Browse files Browse the repository at this point in the history
Add lint and translation to check(:fix) scripts
Add lint-staged script

Signed-off-by: Kevin Cormier <[email protected]>
  • Loading branch information
KevinFCormier authored Feb 17, 2023
1 parent 37416bc commit 2878f65
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "tsc --sourceMap false --declaration false && npx rollup --format es --file backend.mjs -- build/lib/main.js",
"tsc": "tsc --noEmit",
"clean": "rm -rf coverage build",
"check": "npm run tsc",
"check": "concurrently --kill-others-on-fail npm:tsc npm:lint",
"check:fix": "concurrently --kill-others-on-fail npm:tsc npm:lint:fix",
"test": "npm run jest --",
"jest": "node --experimental-vm-modules node_modules/.bin/jest --testResultsProcessor jest-sonar-reporter",
"lint": "eslint src test --ext .ts --max-warnings=0",
Expand Down
6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"build:plugin": "./scripts/checkPlugin.sh && cd plugins/${PLUGIN} && node ../../scripts/generatePluginPackage.js && CONSOLE_PLUGIN_SKIP_EXT_VALIDATOR=true TS_NODE_PROJECT=../../webpack.tsconfig.json webpack -c ../../webpack.plugin.ts --env plugin=$PLUGIN --mode production",
"build:plugin:acm": "PLUGIN=acm npm run build:plugin",
"build:plugin:mce": "PLUGIN=mce npm run build:plugin",
"check": "npm run tsc",
"check": "concurrently --kill-others-on-fail npm:tsc npm:lint npm:i18n",
"check:fix": "concurrently --kill-others-on-fail npm:tsc npm:lint:fix npm:i18n:fix",
"clean": "rm -rf coverage build",
"test": "npm run jest --",
"jest": "jest",
Expand All @@ -21,7 +22,8 @@
"lint:fix": "npm run lint -- --fix",
"prettier": "prettier --check src public",
"prettier:fix": "prettier --write src public",
"i18n": "i18next --fail-on-warnings",
"i18n": "i18next --fail-on-warnings && git diff --exit-code public/locales/en/translation.json",
"i18n:fix": "i18next --fail-on-warnings",
"update": "npx npm-check-updates -x @testing-library/user-event,monaco-editor,eslint,react-router-dom --doctor --upgrade && npm audit fix && npm dedup",
"serve:plugins": "concurrently npm:serve:plugin:* -c green,blue,cyan,magenta",
"serve:plugin": "./scripts/checkPlugin.sh && cd plugins/${PLUGIN} && node ../../scripts/generatePluginPackage.js && CONSOLE_PLUGIN_SKIP_EXT_VALIDATOR=true TS_NODE_PROJECT=../../webpack.tsconfig.json webpack serve -c ../../webpack.plugin.ts --env plugin=$PLUGIN --env port=$PORT --mode development",
Expand Down
1 change: 0 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
return [
`npm run lint:fix:frontend -- ${files}`,
`npm run i18n:frontend`,
'git diff --exit-code frontend/public/locales/en/translation.json',
]
},
}
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
"plugins-dev": "concurrently npm:start:backend npm:serve:plugins -n backend,frontend -c green,blue",
"ocp-console": "./start-ocp-console.sh",
"serve:plugins": "cd frontend && npm run serve:plugins",
"check": "concurrently --kill-others-on-fail npm:copyright:check npm:check:* -c green,blue,magenta",
"check": "concurrently --kill-others-on-fail npm:copyright:check \"npm:check:*(!fix)\" -c green,blue,magenta",
"check:backend": "cd backend && npm run check",
"check:frontend": "cd frontend && npm run check",
"check:fix": "concurrently --kill-others-on-fail npm:copyright:fix npm:check:fix:* -c green,blue,magenta",
"check:fix:backend": "cd backend && npm run check:fix",
"check:fix:frontend": "cd frontend && npm run check:fix",
"lint-staged": "npx lint-staged --no-stash",
"lint": "concurrently --kill-others-on-fail \"npm:lint:*(!fix)\" -c green,blue",
"lint:backend": "cd backend && npm run lint",
"lint:frontend": "cd frontend && npm run lint",
Expand All @@ -28,7 +32,10 @@
"test": "concurrently -P --kill-others-on-fail \"npm:test:* -- {@}\" -c green,blue --",
"test:backend": "cd backend && npm test --",
"test:frontend": "cd frontend && npm test --",
"i18n": "concurrently --kill-others-on-fail \"npm:i18n:*(!fix)\" -c green,blue,magenta",
"i18n:frontend": "cd frontend && npm run i18n --",
"i18n:fix": "concurrently --kill-others-on-fail npm:i18n:fix:* -c green,blue,magenta",
"i18n:fix:frontend": "cd frontend && npm run i18n:fix --",
"build": "concurrently npm:build:* -c green,blue,magenta",
"build:backend": "cd backend && npm run build",
"build:frontend": "cd frontend && npm run build",
Expand Down

0 comments on commit 2878f65

Please sign in to comment.