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

Document recommended setup #7828

Open
lydell opened this issue Mar 22, 2020 · 1 comment
Open

Document recommended setup #7828

lydell opened this issue Mar 22, 2020 · 1 comment

Comments

@lydell
Copy link
Collaborator

@lydell lydell commented Mar 22, 2020

Now that Prettier 2.0 has been released with its improved CLI, I think we should add a section do the docs showing a recommended example setup.

  1. Recommend using an editor extension that lets you run Prettier from your editor. Link to popular extensions. Maybe add some tips on how to configure for example prettier-vscode.
  2. Recommend adding an empty ({}) .prettierrc.json to signify to editor extensions that your project is using Prettier (with default settings).
  3. Recommend adding a .prettierignore if you don’t want to run Prettier on certain files. For example: *.html. Mention that this lets both editor extensions and the Prettier CLI know that you don’t want HTML files to be formatted, unlike putting a glob in some npm script or Makefile.
  4. Recommend using prettier --write . when you want to bulk format everything.
  5. Recommend using prettier --check . in CI.
  6. Maybe mention pre-commit hooks or something. I don’t use that myself so I don’t have a suggestion here.
  7. Maybe mention how to set up LF in git on Windows or something.

I think we should also de-emphasize eslint-plugin-prettier.

  • Prettier editor extensions are must faster than ESLint --autofix editor extensions.
  • Everything annoyingly becomes underlined with red in your editor.
  • The error messages kind of suggest fixing the Prettier formatting manually, which is like the opposite of the Prettier experience.
  • prettier --check . is so easy that you don’t really simplify your configuration by putting Prettier in your ESLint setup.
@mitermayer
Copy link
Member

@mitermayer mitermayer commented Mar 22, 2020

This is could also be relevant for leveraging as the default present for vim-prettier

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.