sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

Issue with rule standard/computed-property-even-spacing #57

Closed jyboudreau closed 5 years ago

jyboudreau commented 6 years ago

When linting with standard, prettier-standard formatting conflicts with the rule standard/computed-property-even-spacing.

Similar to https://github.com/prettier/eslint-config-prettier/issues/29

Prettier standard wants this:

const { whatever } = loooooooooooooooooooooooong[
      something
].some.thiiiiiiiiiiiiing[0]

While standard wants:

const { whatever } = loooooooooooooooooooooooong[something].some.thiiiiiiiiiiiiing[0]
sheerun commented 6 years ago

According to the issue you've posted the solution is to add "prettier/standard" to your extends list in .eslintrc

jyboudreau commented 6 years ago

👍 That does work. Thanks for the workaround, however I would still consider this a bug with prettier-standard.

Since prettier-standard is a formatter and not a linter, it seems that it should be compatible with the standard linter ruleset as is without disabling inconvenient rules. After all, it's a replacement for prettier, not standard.

I understand however that it's not necessarily easy to marry the two since standard also likes to be a formatter 😉

sheerun commented 6 years ago

This is not a workaround, but a solution. standard isn't able to fix this whitespace automatically.

jyboudreau commented 6 years ago

Since standard doesn't allow customization of rules, this means this package is incompatible with standard. Maybe that's fine, but then it raises an additional question:

If we can't use standard with this package and have to use ESLint for linting instead, then why not just use prettier-eslint?

sheerun commented 6 years ago

you can

sheerun commented 5 years ago

prettier-standard 9.0.0 now uses just prettierx for formatting and we recommend using https://github.com/prettier/eslint-config-prettier in .eslintrc to disable any non-compatible whitespace rules set by standard. unfortunately it's not possible to have true 1:1 match between prettier and standard, but we're pretty close :) you can contribute or raise issues to https://github.com/brodybits/prettierx to fix remaining incompatibilities

havenchyk commented 4 years ago

unfortunately it's not possible to have true 1:1 match between prettier and standard

@sheerun does it mean that some of rules should be disabled to prevent conflicts with eslint-config-standard and eslint-confit-standard-jsx

I see indent and react/jsx-curly-newline have conflicts at the moment, so can I just disable them and rely on prettier-standard instead?