-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: Added rule to enforce quotes type #475
Conversation
src/rules/quotes.js
Outdated
fixer.replaceTextRange([node.range[1] - 1, node.range[1]], '"'), | ||
]; | ||
}, | ||
message: 'Strings must use double quote.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should name these as String literals
not just Strings
@angelica-bocanegra It might be a good idea to add this rule here as well: https://github.com/prettier/eslint-config-prettier (https://github.com/prettier/eslint-config-prettier/blob/96efee3dc6d37f9a89d6facb04359a73409cb1e6/index.js#L111-L120) to disable it for Prettier users. |
|
||
<a name="eslint-plugin-flowtype-rules-quotes-options-3"></a> | ||
#### Options | ||
|
||
The rule has string options of: | ||
|
||
* `"double"` (default) requires double quotes around strings. | ||
* `"single"` requires single quotes around strings. | ||
* `"double"` (default) requires double quotes around string literals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I wonder why is default double? Guess same as regular quotes rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep keeping it standard
🎉 This PR is included in version 5.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #473
Added new rule
quotes
that enforces consistent quote types around strings.Options:
double
(default) orsingle
Double (default):
Single:
@gajus