diff --git a/.husky/pre-commit b/.husky/pre-commit index d0a7784..5ca943d 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,5 @@ -npx lint-staged \ No newline at end of file +# 后台运行类型检查,结果输出到 stderr 但不阻塞提交 +npx tsc --noEmit & + +# 前台运行 lint-staged(自动修复 + 格式化) +npx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000..e703b2b --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,6 @@ +# pre-push: 严格检查,阻塞有问题的代码推送到远程 +# 类型检查 +npx tsc --noEmit + +# ESLint 严格检查(不允许 warning) +npx eslint . --max-warnings=0 diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs index 12b9d01..b84fec8 100644 --- a/lint-staged.config.mjs +++ b/lint-staged.config.mjs @@ -1,4 +1,12 @@ +/* global process */ + +const isCI = process.env.CI === 'true'; + export default { - '*.{ts,tsx,js,jsx,mjs}': ['eslint --fix --max-warnings=0 --no-warn-ignored', 'prettier --write'], + '*.{ts,tsx,js,jsx,mjs}': [ + 'eslint --fix --no-warn-ignored', + ...(isCI ? ['eslint --max-warnings=0'] : []), + 'prettier --write', + ], '*.{json,css,scss,md}': ['prettier --write'], }; diff --git a/package.json b/package.json index 07dd898..4c043e3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "testing-tools", "description": "A browser extension providing useful testing tools including timestamp conversion and storage management", "private": false, - "version": "1.0.0", + "version": "1.0.6", "license": "MIT", "type": "module", "scripts": { diff --git a/public/_locales/zh/messages.json b/public/_locales/zh_CN/messages.json similarity index 100% rename from public/_locales/zh/messages.json rename to public/_locales/zh_CN/messages.json diff --git a/wxt.config.ts b/wxt.config.ts index 97afe7d..bdb3329 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -45,7 +45,7 @@ export default defineConfig({ name: 'Testing Tool', description: 'A tool for testing web applications.', version_name: undefined, - default_locale: 'zh', + default_locale: 'zh_CN', permissions: [ 'storage', 'unlimitedStorage',