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

Nudge forward style checks a la eslint-config-standard #1082

Merged
merged 8 commits into from
Oct 2, 2017
Merged

Nudge forward style checks a la eslint-config-standard #1082

merged 8 commits into from
Oct 2, 2017

Conversation

paulmelnikow
Copy link
Member

Because I despise nitpicking stuff like indentation and spacing in pull request comments, I'd like to nudge forward our automated style checking, at least for new files being added.

I don't want to totally rewrite server.js just to get automated style checking… the blame tracking is just too useful. So let's it's just take care of that when we start splitting it out.

More discussion in #948.

@paulmelnikow paulmelnikow added the developer-experience Dev tooling, test framework, and CI label Sep 22, 2017
Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before committing this, consider using Prettier instead. Maybe we could enable Prettier on all files except server.js?

@paulmelnikow
Copy link
Member Author

I'd support dropping it in for the files except server.js. Here's what I wrote about Prettier in #948:

I'm open to pursuing Prettier at some point in the future. It seems a much better solution for formatting. However it doesn't handle the semantic issues, so it doesn't keep us from also needing an eslint config.

@paulmelnikow paulmelnikow merged commit f271b82 into badges:master Oct 2, 2017
@paulmelnikow paulmelnikow deleted the eslint-preferred branch October 2, 2017 01:09
@Daniel15
Copy link
Member

Daniel15 commented Oct 2, 2017

Thanks @paulmelnikow, I missed that comment

However it doesn't handle the semantic issues, so it doesn't keep us from also needing an eslint config.

That's true. However, using a combination of ESLint + Prettier works well. I think you can even run Prettier via ESLint (that is, there's a custom ESLint rule that runs Prettier).

@paulmelnikow
Copy link
Member Author

However, using a combination of ESLint + Prettier works well.

I'm definitely down for that! Let's do it.

@Daniel15
Copy link
Member

Daniel15 commented Oct 2, 2017

I think this is the ESLint plugin I was thinking of: https://github.com/prettier/eslint-plugin-prettier. It supports only running prettier on files that have a particular docblock tag in them (eg. @prettier), which we could add to all files except server.js. This is similar to what we do internally at Facebook (except we have some custom integration rather than using this particular ESLint plugin).

There's also eslint-config-prettier that disables ESLint rules that conflict with Prettier. This lets you use some shared ESLint config along with Prettier and not experience any conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Dev tooling, test framework, and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants