Implement prettier w/ lint-staged + husky
MattIPv4 opened this issue · comments
Implement prettier across the whole repo, default settings.
Using husky + lint-staged, ensure that a pre-commit hook exists for prettier, running on all files.
Remove lint:editorconfig
, replace with lint:prettier
. Add lint:prettier:fix
.
Ensure eslint is happy running alongside prettier.
is it preferred to have eslint/prettier config as their own files, or as part of package.json
?
also, would the PR for this issue include formatting changes across the project, or just the config? i suppose that with implementing the pre-commit hook that it would include the changes
is it preferred to have eslint/prettier config as their own files, or as part of
package.json
?
Separate files, please -- though I imagine we won't have much in the way of a prettier config (I think their defaults are probably fine). The eslint config is currently in the package.json, but I would probably prefer it be in a dedicated file.
also, would the PR for this issue include formatting changes across the project, or just the config? i suppose that with implementing the pre-commit hook that it would include the changes
Yeah, I think it'd make sense to have all the formatting changes. I think it'd be good to have a dedicated commit that is just applying the prettier formatting changes, so it is easier to review (e.g. commit to add prettier, commit to fix existing issues, commit to add lint-staged, etc.)