feat: Added rule to enforce quotes type#475
Conversation
| fixer.replaceTextRange([node.range[1] - 1, node.range[1]], '"'), | ||
| ]; | ||
| }, | ||
| message: 'Strings must use double quote.', |
There was a problem hiding this comment.
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. |
|
|
||
| * `"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.
Hm I wonder why is default double? Guess same as regular quotes rule?
There was a problem hiding this comment.
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
quotesthat enforces consistent quote types around strings.Options:
double(default) orsingleDouble (default):
Single:
@gajus