forked from xun082/create-neat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🚀 新增husky插件,支持husky、commitlint、lint-staged功能(xun082#215) (xun08…
…2#222) * feat: 🚀 新增husky插件,支持husky、commitlint、lint-staged功能(xun082#215) * fix: 🧩 删除自定义脚本 * fix: 🧩 删除多余配置 * fix: 🧩 删除多余配置 --------- Co-authored-by: wuguohao <[email protected]>
- Loading branch information
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.