Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/totallymoney/eslint-plugin-prefer-smart-quotes
📏 Prefer the use of curly quote/apostrophe characters
https://github.com/totallymoney/eslint-plugin-prefer-smart-quotes
apostrophe curly-quotes eslint eslint-plugin linting quotes smart-quotes
Last synced: 3 days ago
JSON representation
📏 Prefer the use of curly quote/apostrophe characters
- Host: GitHub
- URL: https://github.com/totallymoney/eslint-plugin-prefer-smart-quotes
- Owner: totallymoney
- License: mit
- Created: 2021-07-26T14:40:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-01T15:11:16.000Z (about 2 years ago)
- Last Synced: 2024-10-28T16:12:51.450Z (18 days ago)
- Topics: apostrophe, curly-quotes, eslint, eslint-plugin, linting, quotes, smart-quotes
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eslint-plugin-prefer-smart-quotes
- Size: 266 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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 `numeric` or `named` equivalent into their curly `named` or `numeric` values.
## Installation
You'll first need to install ESLint:
```bash
npm install eslint --save-dev
```Then, you can install `eslint-plugin-prefer-smart-quotes`
```bash
npm install eslint-plugin-prefer-smart-quotes --save-dev
```## Usage
Add the plugin to your eslint configuration file (`.eslintrc.*`):
```json
{
"plugins": [
"prefer-smart-quotes"
]
}
```To configure the plugin rules:
### Convert all entities into their curly equivalent
```json
{
"rules": {
"prefer-smart-quotes/prefer": ["error", "all"]
}
}
```### Convert named values into their curly numeric equivalent
```json
{
"rules": {
"prefer-smart-quotes/prefer": ["error", { "inputFormat": "named", "outputFormat": "numeric" }]
}
}
```## Acknowledgements
Thanks to [eslint-plugin-no-smart-quotes](https://github.com/seleb/eslint-plugin-no-smart-quotes) for serving as the basis
for this plugin.