Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quote-props to special rules #150

Closed
EvgenyOrekhov opened this issue Jun 2, 2020 · 5 comments
Closed

Add quote-props to special rules #150

EvgenyOrekhov opened this issue Jun 2, 2020 · 5 comments

Comments

@EvgenyOrekhov
Copy link

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
Copy link
Member

lydell commented Jun 4, 2020

Hi!

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

@EvgenyOrekhov
Copy link
Author

@lydell Yes.

@lydell
Copy link
Member

lydell commented Jun 6, 2020

I opened a pull request to let Prettier quote/unquote numbers just like ESLint: prettier/prettier#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
Copy link
Author

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

@EvgenyOrekhov
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants