epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.9k stars 398 forks source link

Why eslint prettier plugin? #577

Closed fdietze closed 11 months ago

fdietze commented 11 months ago

Hey again! Just looked at my editor and wondered why the formatting check is a linter rule:

https://github.com/epicweb-dev/epic-stack/blob/2db44703aaaef5e59441015ee09845eed0a04fbe/.eslintrc.cjs#L10

image

:see_no_evil:

Looking at the eslint docs, it turns out that:

These plugins were especially useful when Prettier was new. By running Prettier inside your linters, you didn’t have to set up any new infrastructure and you could re-use your editor integrations for the linters. But these days you can run prettier --check . and most editors have Prettier support.

So it probably makes sense to remove those. Or am I overlooking something again?

ananni13 commented 11 months ago

That line in .eslintrc.cjs is not eslint-plugin-prettier, which just like you found in the prettier docs is not recommended anymore.

The project is using eslint-config-prettier, which basically does the opposite: it turns off all lint rules that might conflict with prettier.

I'm not sure why you're seeing all those errors in the editor, it might be some wrong settings/extensions. Did you change anything related to the lint configuration? Try to run npm run lint from your terminal to double check, it should pass without errors.

kentcdodds commented 11 months ago

Yep. Thanks @ananni13 👍

fdietze commented 11 months ago

Thank you for the explanation. Feels extremely weird to me that the linter has rules which conflict with formatting. But I guess that's just javascript land...