2.0.0 • Published 4 years ago
eslint-plugin-prefer-smart-quotes v2.0.0
eslint-plugin-prefer-smart-quotes
Enforce the preferred use of curly quote/apostrophe characters.
Fixable: This rule is automatically fixable using the --fix flag on the command line.
This plugin supports converting quotes and apostrophes that have been specified using their
numericornamedequivalent into their curlynamedornumericvalues.
Installation
You'll first need to install ESLint:
npm install eslint --save-devThen, you can install eslint-plugin-prefer-smart-quotes
npm install eslint-plugin-prefer-smart-quotes --save-devUsage
Add the plugin to your eslint configuration file (.eslintrc.*):
{
"plugins": [
"prefer-smart-quotes"
]
}To configure the plugin rules:
Convert all entities into their curly equivalent
{
"rules": {
"prefer-smart-quotes/prefer": ["error", "all"]
}
}Convert named values into their curly numeric equivalent
{
"rules": {
"prefer-smart-quotes/prefer": ["error", { "inputFormat": "named", "outputFormat": "numeric" }]
}
}Acknowledgements
Thanks to eslint-plugin-no-smart-quotes for serving as the basis for this plugin.