🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-plugin-prefer-smart-quotes

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-prefer-smart-quotes

Prefer the use of curly quote/apostrophe characters

2.0.0
latest
Source
npm
Version published
Weekly downloads
6.8K
-26.25%
Maintainers
4
Weekly downloads
 
Created
Source

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:

npm install eslint --save-dev

Then, you can install eslint-plugin-prefer-smart-quotes

npm install eslint-plugin-prefer-smart-quotes --save-dev

Usage

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.

Keywords

eslint

FAQs

Package last updated on 14 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts