Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Add prettier support, via 'npm run format' #109

Closed
wants to merge 1 commit into from

Conversation

pdehaan
Copy link
Collaborator

@pdehaan pdehaan commented Nov 29, 2017

Dearest @gregglind,

You can see what I mean about it being a pretty sizable (and unstable) diff.
Prettier doesn't offer a ton of configuration options, but if there is something you find horribly offensive below, I think we can do some "ignore" blocks for certain code, or add specific files/folders/extensions to the .prettierignore file.

@gregglind
Copy link
Contributor

Main comment: perhaps I am ignorant, but this feels like eslint, and prettier are in conflict about many aspects here.

I appreciate the work on this, and trying to see how gory the changes are! Some seem obviously good and some seem... gory!

/me off to look more at how prettier work.

@gregglind
Copy link
Contributor

@pdehaan
Copy link
Collaborator Author

pdehaan commented Nov 30, 2017

Yeah, Prettier and ESLint rules and configs can definitely conflict, so it's generally better to disable any Prettier formatting-related rules (quotes, trailing commas, spacing) in ESLint so they don't fight each other.

Or if you want to go the "prettier in eslint" route, I can try submitting a separate PR for that so we can battle them side-by-side. I've gotten it working in the past, but sometimes formatting errors will show up in ESLint with less than helpful error messages.

@pdehaan
Copy link
Collaborator Author

pdehaan commented Nov 30, 2017

But let me know if you have any specific "gore" that you want me to research. Naturally we can have Prettier ignore JSON files, or Markdown files or other things where formatting is less helpful.

@gregglind
Copy link
Contributor

gregglind commented Nov 30, 2017 via email

@motin
Copy link
Contributor

motin commented Feb 28, 2018

In the template, this is currently under review.
By using a combination of prettier + eslint --fix the code does not go against any eslint rules.
I am all for using this for addon-utils as well. It will not result in code formatted to everyone's liking, but that is the point and philosophy of prettier, to force one standard code style and avoid having to discuss what code style to agree on.
I will open a new PR for this based on the latest branches as soon as existing PRs have been merged or closed.

@motin
Copy link
Contributor

motin commented Apr 3, 2018

The changes in this PR were rebased and included in #119 which is now merged.

@motin motin closed this Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants