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

add prettier and prettying everything #3401

Merged
merged 4 commits into from
May 16, 2017
Merged

Conversation

voxsim
Copy link
Contributor

@voxsim voxsim commented May 14, 2017

Summary

This fix #3318.

Test plan

Tests already in place and green :D

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

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

Awesome!

ignore: ['**/node_modules/**'],
options: {
'bracket-spacing': 'false',
'print-width': 120,
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when we change this to 80 (or 100)? Prettiers output actually looks worse the longer the line-length is because it tries to cram everything into one line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah ok I can reduce the number and run yarn prettier if you prefer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the jest project there is 80 for print-width

@sebmck sebmck self-requested a review May 15, 2017 12:56
Copy link
Contributor

@sebmck sebmck left a comment

Choose a reason for hiding this comment

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

What's the point of scripts/prettier.js? You can use eslint-plugin-prettify and then you can use eslint . --fix. Reusing the existing lint infra seems best.

@voxsim
Copy link
Contributor Author

voxsim commented May 15, 2017

Ah ok I really don't know that plugin, I can switch to eslint-plugin-prettify if we prefer, I see what the jest project does and copy it (infact if you see the file is the same apart some modifications).

@@ -0,0 +1,60 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

People say you can use thus plugin https://github.com/zertosh/eslint-plugin-prettify instead of this file now

@voxsim
Copy link
Contributor Author

voxsim commented May 16, 2017

@kittens @bestander @cpojer now should works as expected :)

@bestander bestander merged commit 25890c8 into yarnpkg:master May 16, 2017
@voxsim
Copy link
Contributor Author

voxsim commented May 16, 2017

I am sorry but this not works as expected for some reasons:

  • ESLint's --fix flag will not apply fixes anymore. This is a known issue of processors. However, the fix information is still outputted to formatters. So if you're using ESLint through something like Arcanist, the fixes will work. (https://github.com/zertosh/eslint-plugin-prettify#caveats)
  • I used the string "fb" to set "Facebook defaults", but I have to add a docblock with /** @format */ in every page and it seems not to work if the file already has /* @flow */ as docblok O.o

I will dig further and maybe i will open another pull request.

@bestander
Copy link
Member

Thanks, should we revert?

@bestander
Copy link
Member

Or a patch would be fine?

@voxsim
Copy link
Contributor Author

voxsim commented May 16, 2017

Maybe now it is better to revert everything, I really don't know how much it could take.
If it will be problematic I should re-open a pr with the custom scripts like jest does.

@voxsim
Copy link
Contributor Author

voxsim commented May 16, 2017

@bestander after thinking a while, if i open a patch and I delete eslint-plugin-prettify and reintroduce the custom scripts, would it be fine? I mean without reverting everything

@bestander
Copy link
Member

Yeah, let's have a temporary patch

GulajavaMinistudio added a commit to GulajavaMinistudio/yarn that referenced this pull request May 17, 2017
add prettier and prettying everything (yarnpkg#3401)
@RomanovRoman
Copy link

@voxsim
it's about #3401 (comment)
Link https://github.com/zertosh/eslint-plugin-prettify#caveats is broken because eslint-plugin-prettify merged into https://github.com/prettier/eslint-plugin-prettier.
I can't find any "caveats" in docs.
Have you some progress?

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

Successfully merging this pull request may close these issues.

Use Prettier
5 participants