Skip to content

Commit 4796677

Browse files
authored
Create presubmit hooks for i18n (#1763)
* Add locale scripts to package.json * Add i18n hooks
1 parent 01ac9d9 commit 4796677

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lint-staged.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export default {
66
'vue-tsc --noEmit',
77
'tsc --noEmit',
88
'tsc-strict'
9+
],
10+
11+
'./src/locales/*.json': (stagedFiles) => [
12+
'lobe-i18n locale',
13+
...formatFiles(stagedFiles)
914
]
1015
}
1116

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"prepare": "husky || true",
2929
"preview": "vite preview",
3030
"lint": "eslint src",
31-
"lint:fix": "eslint src --fix"
31+
"lint:fix": "eslint src --fix",
32+
"locale": "lobe-i18n locale"
3233
},
3334
"devDependencies": {
3435
"@babel/core": "^7.24.7",

0 commit comments

Comments
 (0)