Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Add Prettier and Lint-staged config#2

Open
simison wants to merge 2 commits intomasterfrom
update/lint-staged
Open

Add Prettier and Lint-staged config#2
simison wants to merge 2 commits intomasterfrom
update/lint-staged

Conversation

@simison
Copy link
Contributor

@simison simison commented Jun 21, 2020

I started playing with some code and I had trouble with my editor integrations. 😅

You might have Prettier directly in the editor as dependency or installed globally?

I've:

  • Added Prettier as an explicit dependency
  • Added Lint-staged which runs Eslint and Prettier on commit

Now when I modify files, they get reformatted as I save them and for others without editor integrations as they commit them.

Removed semi: 'never' rule from Eslint config — I don't have preference over the way or the other but it was causing trouble by conflicting between Eslint and Prettier.

First Eslint said "never" is not valid (needs to be "off", "warn", "error"). Then I switched it to error and it became a conflict between Eslint and Prettier:

Screenshot 2020-06-21 at 20 43 33

Screenshot 2020-06-21 at 20 43 39

It was a battle of two mighty ones so I just figured let them find peace and harmony and remove all rules. 😅

This will add tons of noise next time you commit anything since it'll reformat files by Prettier and by this rule-removal.

Happy to just npx prettier . --write it all right next up and move on. 😁

Thoughts?

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.

1 participant