Skip to content

Commit

Permalink
chore: lint-staged improvements (#556)
Browse files Browse the repository at this point in the history
This makes two improvements to `lint-staged`:

- Run Prettier on all files, not just some extensions.

- Only check files, not fix them. This addresses a race condition
  (search [lint-staged's docs][0] for "race condition").

[0]: https://www.npmjs.com/package/lint-staged
  • Loading branch information
EvanHahn committed Apr 11, 2024
1 parent df71f6a commit 204e222
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
},
"lint-staged": {
"*.js": [
"eslint --cache --fix"
"eslint --cache"
],
"*.{js,css,md}": "prettier --write"
"*": [
"prettier --check"
]
},
"eslintConfig": {
"env": {
Expand Down

0 comments on commit 204e222

Please sign in to comment.