Skip to content

Commit

Permalink
chore: 🔨 fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
caorushizi committed Apr 5, 2024
1 parent 2953b4a commit 61d0173
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 17 deletions.
30 changes: 29 additions & 1 deletion .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
behaviour
Byelide
commitlint
conventionalcommits
optimizelegibility
pinia
tiptap
vuedraggable
vuejs
TDAPP
reduxjs
bilibili
localforage
ahooks
antd
languagedetector
redownload
Redownload
watting
Watting
cancle
Sider
inversify
datetime
typeorm
bili
mediago
nocheck
metas
DDTHH
Conpty
execa
bodys
cliqz
adblocker
acodec
KHTML
svgz
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec tsx ./scripts/pre-commit.ts
npx tsx ./scripts/pre-commit.ts
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"prepare": "husky",
"commit": "git-cz",
"commitlint": "commitlint --edit",
"spellcheck": "cspell lint --dot --gitignore --color --cache --show-suggestions \"src/**/*.@(html|js|cjs|mjs|ts|tsx|css|scss|md|vue)\""
"spellcheck": "cspell \"packages/**/src/**/*.{ts,tsx}\""
},
"keywords": [],
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ElectronApp {
private readonly store: ElectronStore,
) {}

private async seriveInit(): Promise<void> {
private async serviceInit(): Promise<void> {
this.mainWindow.init();
this.webview.init();
}
Expand All @@ -55,7 +55,7 @@ export default class ElectronApp {
// vendor
await this.vendorInit();
// service
await this.seriveInit();
await this.serviceInit();

app.on("activate", () => {
this.mainWindow.init();
Expand Down
25 changes: 13 additions & 12 deletions scripts/check.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/usr/bin/env zx

import { echo } from "zx";
import { $, echo } from "zx";
import type { ProcessOutput } from "zx";
import { printObject } from "./utils";

echo("开始执行代码质量评估...\n");
// import type { ProcessOutput } from "zx";
// import { printObject } from "./utils";

// await $`pnpm spellcheck`.catch((out: ProcessOutput) => {
// throw new Error(out.stdout);
// });
await $`pnpm spellcheck`.catch((out: ProcessOutput) => {
printObject(out);
throw new Error(out.stdout);
});

// check type and stage
// await Promise.all([$`pnpm types`, $`pnpm lint-stage`]).catch(
// (out: ProcessOutput) => {
// printObject(out);
// throw new Error(out.stdout);
// },
// );
await Promise.all([$`pnpm types`, $`pnpm lint-staged`]).catch(
(out: ProcessOutput) => {
printObject(out);
throw new Error(out.stdout);
},
);

0 comments on commit 61d0173

Please sign in to comment.