File tree Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 3
3
## 安装
4
4
5
5
``` bash
6
- npm i @codegenius/clear-plugin
6
+ npm i @codegenius/clear-plugin -D
7
7
```
8
8
9
9
``` javascript
10
- // 开发期间使用
11
10
import { defineConfig } from " code-genius" ;
12
- import clearInstaller from " @codegenius/clear-plugin" ;
11
+ import { clearInstaller } from " @codegenius/clear-plugin" ;
13
12
14
13
export default defineConfig ({
15
14
plugins: [
16
15
clearInstaller ({
17
- files: [" ./src " ],
16
+ files: [" ./dist " , " ./node_modules " ],
18
17
}),
19
18
],
20
19
});
@@ -56,24 +55,9 @@ codeg clear --ask
56
55
### API 模式
57
56
58
57
``` typescript
59
- import { clear } from " code-genius " ;
58
+ import { clear } from " @codegenius/clear-plugin " ;
60
59
61
60
(async () => {
62
61
await clear ([" ./dist" ]);
63
62
})();
64
- ```
65
-
66
- ### 配置文件
67
-
68
- ``` typescript
69
- # 覆盖默认的 ` files ` 配置
70
- import { defineConfig } from " code-genius" ;
71
-
72
- export default defineConfig ({
73
- commands: {
74
- clear: {
75
- files: [" ./dist" ]
76
- },
77
- },
78
- });
79
- ```
63
+ ```
Original file line number Diff line number Diff line change 58
58
"simple-git-hooks" : " ^2.9.0"
59
59
},
60
60
"simple-git-hooks" : {
61
- "pre-commit" : " codeg format && codeg impsort -p src"
61
+ "pre-commit" : " npx esno scripts/lint-script.ts" ,
62
+ "commit-msg" : " codeg verify"
62
63
}
63
64
}
Original file line number Diff line number Diff line change
1
+ import { eslintFix } from "code-genius" ;
2
+ import { impSort } from "code-genius" ;
3
+ import { checkGitUserEmail } from "code-genius" ;
4
+ import { prettierFormat } from "code-genius" ;
5
+ import { execCommand } from "code-genius" ;
6
+
7
+ async function lint ( ) {
8
+ await checkGitUserEmail ( "^[a-zA-Z0-9._%+-]+@(gmail)\\.(com)$" ) ;
9
+ await prettierFormat ( [ "./src/" , "./scripts/" ] ) ;
10
+ await eslintFix ( [ "./src/" , "./scripts/" ] ) ;
11
+ await impSort ( [ "./src/" , "./scripts/" ] ) ;
12
+ await execCommand ( "git" , [ "add" , "." ] ) ;
13
+ }
14
+
15
+ lint ( ) ;
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ async function prepare() {
4
4
gitInitSimpleHooks ( ) ;
5
5
}
6
6
7
- prepare ( ) ;
7
+ prepare ( ) ;
You can’t perform that action at this time.
0 commit comments