Closed EvgenyOrekhov closed 4 years ago
Hi!
Am I understanding this right – is "quote-props": ["error", "as-needed", { "numbers": true }]
used to enforce quotes around numbers?
@lydell Yes.
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?
I would prefer Prettier to be more opinionated and use Prettier's defaults, and just disable ESLint's rule.
Looks like this issue is no longer valid since Prettier 2.1 now quotes/unquotes number keys.
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 }]