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

MTV-1980: Add husky - pre commit hook #1500

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# .husky/pre-commit

yarn lint-staged

echo "run yarn i18n"
yarn i18n

translation_file_diff=$(git diff --name-only packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json)

if [ -n "$translation_file_diff" ]; then
git add $translation_file_diff
fi

# see what's going to be committed
git status
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"packages/common",
"packages/forklift-console-plugin"
],
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --config packages/eslint-plugin/.eslintrc.cjs --fix",
"prettier --config packages/eslint-plugin/.prettierrc.cjs --write"
]
},
"scripts": {
"clean": "rm -rf ./dist ./coverage && yarn workspace @kubev2v/common run clean && yarn workspace @kubev2v/forklift-console-plugin run clean",
"clean:all": "yarn run clean && rm -rf ./node_modules ./tmp",
Expand All @@ -33,7 +39,8 @@
"e2e:console": "bash ./ci/deploy-console.sh",
"e2e:pre-test": "yarn run e2e:cluster && yarn run e2e:build && yarn run e2e:deployCrds && yarn run e2e:console",
"storybook": "yarn workspace @kubev2v/common run storybook dev -p 6006",
"storybook:build": "yarn workspace @kubev2v/common run storybook build"
"storybook:build": "yarn workspace @kubev2v/common run storybook build",
"postinstall": "husky"
},
"devDependencies": {
"@cspell/eslint-plugin": "^6.31.1",
Expand All @@ -59,9 +66,11 @@
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-testing-library": "^5.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^9.1.7",
"i18next-parser": "^9.3.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lint-staged": "^15.4.3",
"prettier": "^2.7.1",
"rollup": "^4.22.4",
"rollup-plugin-analyzer": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const base = {

// take the place of `.eslintignore`
'dist/',
'distlib/',
'generated/',
'node_modules/',
'storybook-static/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
"Progress": "Progress",
"Project": "Project",
"Project ID": "Project ID",
"Project new": "Project new",
"Projects": "Projects",
"Projects, also known as namespaces, separate resources within clusters.": "Projects, also known as namespaces, separate resources within clusters.",
"Provider credentials": "Provider credentials",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const ProjectNameSelect: FC<ProjectNameSelectProps> = ({

return (
<FormGroupWithHelpText
label={t('Project')}
label={t('Project new')}
isRequired
fieldId="project"
labelIcon={
Expand Down
Loading
Loading