-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: 🚀 新增husky插件,支持husky、commitlint、lint-staged功能(#215) * fix: 🧩 删除自定义脚本 * fix: 🧩 删除多余配置 * fix: 🧩 删除多余配置 --------- Co-authored-by: wuguohao <[email protected]> (cherry picked from commit b272a18)
- Loading branch information
1 parent
f812628
commit f4112f5
Showing
6 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = (generatorAPI) => { | ||
generatorAPI.extendPackage({ | ||
scripts: { | ||
postinstall: "husky install", | ||
}, | ||
"lint-staged": { | ||
"*.{ts,tsx,js,jsx}": ["pnpm format:ci", "pnpm lint:ci"], | ||
}, | ||
devDependencies: { | ||
husky: "^9.0.11", | ||
"lint-staged": "^15.2.0", | ||
"@commitlint/cli": "^18.4.3", | ||
"@commitlint/config-conventional": "^18.4.3", | ||
}, | ||
}); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/@plugin/plugin-husky/generator/template/.husky/commit-msg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo 'running commit-msg checks ...' |
1 change: 1 addition & 0 deletions
1
packages/@plugin/plugin-husky/generator/template/.husky/pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo 'running pre-commit checks ...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const PluginConfig = require("./generator/index.cjs"); | ||
|
||
const pluginHusky = (buildTool) => { | ||
return PluginConfig[buildTool] ?? console.warn(`Unsupported build tool: ${buildTool}`); | ||
}; | ||
|
||
module.exports = { | ||
pluginHusky, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "@laconic/plugin-husky", | ||
"version": "1.0.0", | ||
"description": "husky plugin for create-neat", | ||
"main": "index.cjs" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.