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

automate code formatting #2980

Closed
boneskull opened this issue Sep 3, 2017 · 6 comments
Closed

automate code formatting #2980

boneskull opened this issue Sep 3, 2017 · 6 comments
Labels
area: repository tooling concerning ease of contribution semver-patch implementation requires increase of "patch" version number; "bug fixes"

Comments

@boneskull
Copy link
Contributor

I've played with prettier a bit, and it seems like a reasonable solution (especially when combined with husky) to enforce a code style across the codebase.

This should prevent nitpicks about style in PRs.

We could also likely make the pre-commit hook run eslint --fix.

semver-patch because it should have no impact upon API or program output.

@boneskull boneskull added area: repository tooling concerning ease of contribution semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Sep 3, 2017
@boneskull
Copy link
Contributor Author

A thing that will happen if we do this is pretty much every file will be touched, because there's no way to disable some of the disagreements between prettier and semistandard.

@boneskull
Copy link
Contributor Author

to be more specific, prettier will remove the spaces after the function keyword and that's that. I don't really care. does anyone care?

fwiw, I'm cool with using a more unopinionated formatter if one exists. the killer feature here for Mocha is automatic application of a style--not the style itself--but prettier conflates the two. that's fine for FB and solves their problem, but it's not necessarily Mocha's problem.

@boneskull
Copy link
Contributor Author

(because Mocha is not thousands of javascript projects, it's just one)

@ScottFreeCode
Copy link
Contributor

I wouldn't at all mind losing the spaced between function and (. I've never seen that outside of JS projects that rely on Standard for their linting.

I believe XO is designed to work better with Prettier and to be less stubbornly opinionated, if I heard correctly in the past.

@bakkot
Copy link

bakkot commented May 12, 2018

Drive-by: it looks this issue was addressed by #3344?

@boneskull
Copy link
Contributor Author

@bakkot totally missed it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: repository tooling concerning ease of contribution semver-patch implementation requires increase of "patch" version number; "bug fixes"
Projects
None yet
Development

No branches or pull requests

3 participants