
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
eslint-plugin-curly-quotes
Advanced tools
Enforce the use of curly quotes and apostrophes.
✨ Simple and customizable 🔧 Compatible with JavaScript, TypeScript, JSX and Vue!
Fixable: This rule is automatically fixable using the --fix flag on the command line.
CAUTION
The plugin replaces quotes used in query selector or stringified JSON strings when using the
--fixflag on the command line. To ignore a specific string:Use tagged template literals:
String.raw`{"foo": "bar"}`Or disable the rule for the line:
const data = '{"foo": "bar"}' // eslint-disable-line curly-quotes/no-straight-quotes
Install ESLint:
npm i --save-dev eslint
Install eslint-plugin-curly-quotes:
npm i --save-dev eslint-plugin-curly-quotes
Add eslint-plugin-curly-quotes to the plugins section of your eslint.config.mjs configuration file:
import curlyQuotes from "eslint-plugin-curly-quotes"
export default [
{
plugins: {
"curly-quotes": curlyQuotes,
},
},
]
Then add the no-straight-quotes rule to the rules section:
import curlyQuotes from "eslint-plugin-curly-quotes"
export default [
{
plugins: {
"curly-quotes": curlyQuotes,
},
rules: {
"curly-quotes/no-straight-quotes": "warn",
},
},
]
You may customize the characters used to replace straight quotes:
import curlyQuotes from "eslint-plugin-curly-quotes"
export default [
{
plugins: {
"curly-quotes": curlyQuotes,
},
rules: {
"curly-quotes/no-straight-quotes": [
"warn",
{
"single-opening": "‘",
"single-closing": "’", // This character is also used to replace apostrophes.
"double-opening": "“",
"double-closing": "”",
"ignored-elements": ["script", "style"], // Straight quotes in these JSX elements are ignored.
"ignored-attributes": ["className", "id", "key", "style"], // Straight quotes in these JSX attributes are ignored.
"ignored-function-calls": [
"document.querySelector",
"document.querySelectorAll",
"Error",
"RegExp", // This also ignores regular expression literals.
], // Straight quotes passed as parameters to these functions are ignored.
"ignored-object-properties": [], // Straight quotes in these object properties are ignored.
},
],
},
},
]
eslint-plugin-prefer-smart-quotesFAQs
Enforce the use of curly quotes
The npm package eslint-plugin-curly-quotes receives a total of 2,379 weekly downloads. As such, eslint-plugin-curly-quotes popularity was classified as popular.
We found that eslint-plugin-curly-quotes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.