Mug*_*tsu -1
通过结合 lint-staged,我成功地仅对所需的文件夹更改运行 husky hooks 检查。
module.exports = {
'*': (files) => {
const isAppFolderChanges = files.some((fileName) =>
fileName.includes('/app/'),
)
const scripts = [
'npm run lint-fix',
'./node_modules/.bin/pretty-quick --staged',
'npm test',
]
return isAppFolderChanges ? scripts : []
},
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3287 次 |
| 最近记录: |