Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier Configurations #624

Open
ptvrajsk opened this issue Mar 6, 2021 · 5 comments
Open

Prettier Configurations #624

ptvrajsk opened this issue Mar 6, 2021 · 5 comments

Comments

@ptvrajsk
Copy link
Contributor

ptvrajsk commented Mar 6, 2021

Should we configure prettier to catch the following errors? Feels like it would be more convenient to have prettier correct them on a commit level.

image

@dingyuchen
Copy link
Contributor

I foresee some difficulties since prettier is too opinionated; it will catch way too many errors in the current code base.

Say we allow prettier to only lint staged files outside of /tests and /e2e, it be too strict and fail on extraneous style issues like p => !!p (p) => !!p.
If we commit the prettier suggestions there would likely be too many changes that it obscures the purpose of the PR. :/

Not sure what would be the best way to proceed to incrementally adopt prettier into the main code base.

@ptvrajsk
Copy link
Contributor Author

@dingyuchen
Hmm is there a way to get prettier to only lint files that have been changed or staged for commit? I've not exactly checked the config options but if this was a solution then that way we can limit the changes that prettier makes to the files that are currently being edited for the PR and not obscure the changes in the PR by including files from other areas.

@anubh-v
Copy link
Contributor

anubh-v commented Mar 10, 2021

we can limit the changes that prettier makes to the files that are currently being edited for the PR and not obscure the changes in the PR by including files from other areas

I think the problem is that, even if we limit prettier to staged files, prettier will format large sections of the staged files. This would still obscure the PR's work.

This issue can be addressed when we adopt prettier for the whole project (perhaps towards the end of this semester).

@ptvrajsk
Copy link
Contributor Author

Sure 👍

@AudreyFelicio
Copy link
Contributor

@dingyuchen @anubh-v @ptvrajsk
Hi everyone,
Is this issue still available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants