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 to Code Style Practices #85

Merged
merged 7 commits into from
Dec 14, 2017

Conversation

septa97
Copy link
Contributor

@septa97 septa97 commented Nov 25, 2017

No description provided.

@goldbergyoni
Copy link
Owner

@septa97 thanks for joining the battle :)

I'd like to clarify that a bit - why prefer prettier over eslint fixes? they at least overlap, no? should we mention vendors like this or maybe focus on the need and the less explicitly at the bottom specify few vendors?

@goldbergyoni goldbergyoni self-assigned this Nov 26, 2017
@septa97
Copy link
Contributor Author

septa97 commented Nov 27, 2017

Prettier is made specifically to format code unlike ESLint that format codes and at the same time, it checks for possible code errors (linting). My practice in my projects is to use Prettier to format the code and to use ESLint to check for errors.

Here is the link of an instance where Prettier performs better than ESLint in code formatting.

And yes, Prettier and ESLint overlaps in the code formatting feature but it can be easily solved by using other packages like prettier-eslint, eslint-plugin-prettier, and eslint-config-prettier. For more information about their difference, you can view the link here.

@septa97
Copy link
Contributor Author

septa97 commented Nov 27, 2017

Those 3 packages that I mentioned are for Prettier and ESLint integration.

@septa97
Copy link
Contributor Author

septa97 commented Nov 27, 2017

Just a question, do you think I should just include this in section 3.1 together with ESLint? Since they are meant to be used together.

@goldbergyoni
Copy link
Owner

@septa97 sorry for the late reply, somehow missed this useful thread.

I think the case for prettier is clear and valuable, I would include it as part of ESLint:

  • Within the TL&DR would mention briefly that it can auto-fix automatically and consider using Prettier which speciailizes in fix
  • Within the details page elaborate more, include code example (the one you provided is great) and link to the extensions you provided

cool?

thanks!

@septa97
Copy link
Contributor Author

septa97 commented Dec 14, 2017

Done changing the PR. I'll kindly wait for your review and comments.

@goldbergyoni goldbergyoni merged commit 49dff19 into goldbergyoni:master Dec 14, 2017
@goldbergyoni
Copy link
Owner

@septa97 I merged the PR, great contribution.

Had to perform two changes because both are not aligned with our writing guidelines which we should publics in few days... you couldn't know, this is why I explain here:

  1. I left only ESLint in the title - we recommend a specific and single tool when it absolutely 5X time mothe re popular than others. Prettier seems great but has competitors and it doesn't control this segment like ESLint does. It worth a recommendation but at the same level with ESlint
  2. The detail page wasn't done with our template, it has different sections - all pages should have similar structure. I'll send you the template today and let's format this page then link to it?

Anyway, great addition, you've your flower at the home page :)

elite0226 pushed a commit to elite0226/nodebestpractices that referenced this pull request Oct 31, 2022
Add Prettier to Code Style Practices
MatanYadaev pushed a commit to MatanYadaev/nodebestpractices that referenced this pull request Aug 16, 2023
…/add-huhgawz

docs: add huhgawz as a contributor
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.

None yet

2 participants