Enforce consistent code style
- Dominant language
- Pug
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
After #835 is merged, it'd be nice to enforce the code style so all our JS / TS code will look and read the same. For this we can use a pre-commit hook with [husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged) so eslint / prettier would run _before_ every commit.
Example package.json config:
```
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,js,json,yml,md}": "prettier --write",
"*.{ts,js}": "eslint --fix"
},
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by checking the package.json setup after issue #835 is merged. Confirm how husky and lint-staged should invoke ESLint and Prettier for the listed JS, TS, JSON, YAML, and Markdown files; done means the pre-commit hook consistently formats and lints staged code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, typescript
- Domain
- developer-experience, tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100