-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Prettier configurations #96
Comments
I concur. Prettier improves consistency and lightens developer burden. Edit: I don't care if the formatter we use is prettier or something else. It'd just be nice to have a tool automatically format my code |
Mentioned to @pakdev that you can use prettier-eslint (like Nimble does) with prettier so that the NI Eslint rules are followed but sounded like the goal was to get the NI JavaScript Styleguide to recommend that by default instead of per project / code base / team. |
According to the prettier-eslint project:
So, this project isn't any different from manually configuring prettier to adhere to our eslint rules. I was able to accomplish that for Javascript with this simple config:
Note: It's possible there are other settings required that just haven't been exercised in the code I formatted. Because of that uncertainty, prettier-eslint is beneficial as it infers a prettier config from eslint's config. However, my point is prettier-eslint isn't somehow avoiding the "should we use prettier" debate (in part or in whole) |
And maybe this recommendation would be too big of a pill for the NI Javascript Styleguide to swallow. The alternative is to at least allow its usage on a developer-by-developer basis. What do you think about the following guidance? "Individual developers are allowed (and encouraged) to use code formatting tools as they see fit so long as their changes do not conflict with the established eslint rules of this guide. However, if their code formatter introduces changes outside of the code they're directly modifying, they must first submit the code formatter changes in a separate PR." |
This will just result in constant formatting changes when not all developers are using Prettier in a repository. Therefore, maybe should be repository by repository. |
Maybe. I'd be curious to see if that's the case though and why - especially if this project provides prettier/<code formatter> config(s). Perhaps we could fix these inconsistencies by activating more eslint rules (or making the formatter less opinionated, though that's my least favorite approach) |
https://prettier.io/
The text was updated successfully, but these errors were encountered: