prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.4k stars 254 forks source link

Add quote-props to special rules #150

Closed EvgenyOrekhov closed 4 years ago

EvgenyOrekhov commented 4 years ago

The quote-props rule has an additional numbers option that can be enabled and still not conflict with Prettier, since Prettier preservers the original quotes for numbers (playground demo).

So one can use the following configuration in addition to Prettier:

"quote-props": ["error", "as-needed", { "numbers": true }]

lydell commented 4 years ago

Hi!

Am I understanding this right – is "quote-props": ["error", "as-needed", { "numbers": true }] used to enforce quotes around numbers?

EvgenyOrekhov commented 4 years ago

@lydell Yes.

lydell commented 4 years ago

I opened a pull request to let Prettier quote/unquote numbers just like ESLint: https://github.com/prettier/prettier/pull/8508

When that’s merged, the only way I can think of to use ESLint’s quote-props together with Prettier is by setting quoteProps: "preserve" in Prettier, to let ESLint make the decisions completely on its own. But why would one want to do that? Any comments or thoughts?

EvgenyOrekhov commented 4 years ago

I would prefer Prettier to be more opinionated and use Prettier's defaults, and just disable ESLint's rule.

EvgenyOrekhov commented 4 years ago

Looks like this issue is no longer valid since Prettier 2.1 now quotes/unquotes number keys.