AccessibleForAll / AccessibleForAll/a11y-advent-calendar
Make Husky stage the formatted files
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 27
描述
Minor fix, husky needs to stage the changed files after it runs npm run format and npm run lint. NOT let the commits of the old files go through.
step 1: npm install --save-dev lint-staged
step 2: add in package.json :
"lint-staged": {
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{scss,css,json,md}": ["prettier --write"]
}
step 3: replace the whole .husky/pre-commit to only have: npx lint-staged
This should do the trick.
贡献指南
这个仓库没有索引到贡献指南
调研方向
Look at the .husky/pre-commit hook file and the package.json to understand the current setup. Install lint-staged, update the package.json with the provided lint-staged configuration, and replace the pre-commit hook content with 'npx lint-staged'. Test by making a commit to ensure the staged files are automatically formatted and linted.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- eslint, git, javascript, nodejs, typescript
- 领域
- build-system, developer-experience, tooling
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 75/100