joeblethephilgray / svelte-playground

The goal of this project is to gain practical experience and insight working with web components and the Svelte UI framework.
0 stars 1 forks source link

Eslint prettier #12

Closed thephilgray closed 6 years ago

thephilgray commented 6 years ago

Among several popular eslint/prettier integration options, eslint-plugin-prettier requires the fewest dependencies and is the simplest for our needs.

It would be enough to only use prettier. We agreed on just a few simple rules (semicolons, double-quotes, and 2-space indents), all of which come out-of-the-box with prettier defaults.

I declared prettier rules in .prettierrc for the rules we agreed upon to override local editor settings (for instance, I have prettier.singleQuote set to true in my user settings).

The eslint plugin allows us to use eslint's robust configuration as well as any eslint plugins we may choose down the road along and prettier without conflicts. Eslint will handle all rules in the standard way. It will provide feedback (error – and red, squiggly line) if a prettier rule is broken, but will yield to prettier for handling in those cases.

Compared with prettier-eslint and eslint-config-prettier.

TODO: While this solution meets the requirements we discussed, it does not account for linting within svelte components (*.html). That's better saved for another issue, but I'll just leave these links here: