# esformatter-quotes

> esformatter plugin: enforces coding style that string literals are delimited with single or double quotes.

Latest version **1.1.0** (published 2016-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install esformatter-quotes
pnpm add esformatter-quotes
yarn add esformatter-quotes
bun add esformatter-quotes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-06-05 |
| First published | 2014-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Miller Medeiros |
| Maintainers | millermedeiros, twolfson |
| Keywords | esformatter, esformatter-plugin, string, quotes, AST |

## Links

- npm: https://www.npmjs.com/package/esformatter-quotes
- Repository: https://github.com/millermedeiros/esformatter-quotes
- Issues: https://github.com/millermedeiros/esformatter-quotes/issues
- npm.io page: https://npm.io/package/esformatter-quotes

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-06-05
- 1.0.3 — 2015-07-29
- 1.0.2 — 2015-06-09
- 1.0.1 — 2015-03-24
- 1.0.0 — 2014-06-21

## README

# esformatter-quotes

[esformatter](https://github.com/millermedeiros/esformatter) plugin for
single/double quotes normalization.


## Usage

install it:

```sh
npm install esformatter-quotes
```

and add to your esformatter config file:

```json
{
  "plugins": [
    "esformatter-quotes"
  ],
  "quotes": {
    "type": "single",
    "avoidEscape": false
  }
}
```


## Options

  - **type:String**
    - if code should use "single" or "double" quotes.
  - **avoidEscape:Boolean**
    - `true` if you want to avoid escaping quotes when possible.

```js
// register plugin
esformatter.register(require('esformatter-quotes'));
// pass options as second argument
var output = esformatter.format(str, {
  "quotes": {
    "type": "single",
    "avoidEscape": false
  }
});
```

## Examples

Given this input program:

```js
var singleQuote = 'single';
var doubleQuote = "double";
var avoidSingle = 'single "quote"';
var avoidDouble = "double 'quote'";
var lorem = "ipsum \"dolor\" sit 'amet'";
var maecennas = 'ipsum \'dolor\' sit "amet"';
```

Will you get the following output based on the config options:


### {type: 'single'}

```js
var singleQuote = 'single';
var doubleQuote = 'double';
var avoidSingle = 'single "quote"';
var avoidDouble = 'double \'quote\'';
var lorem = 'ipsum "dolor" sit \'amet\'';
var maecennas = 'ipsum \'dolor\' sit "amet"';
```

### {type: 'single', avoidEscape: true}

```js
var singleQuote = 'single';
var doubleQuote = 'double';
var avoidSingle = 'single "quote"';
var avoidDouble = "double 'quote'";
var lorem = 'ipsum "dolor" sit \'amet\'';
var maecennas = 'ipsum \'dolor\' sit "amet"';
```

### {type: 'double'}

```js
var singleQuote = "single";
var doubleQuote = "double";
var avoidSingle = "single \"quote\"";
var avoidDouble = "double 'quote'";
var lorem = "ipsum \"dolor\" sit 'amet'";
var maecennas = "ipsum 'dolor' sit \"amet\"";
```

### {type: 'double', avoidEscape: true}

```js
var singleQuote = "single";
var doubleQuote = "double";
var avoidSingle = 'single "quote"';
var avoidDouble = "double 'quote'";
var lorem = "ipsum \"dolor\" sit 'amet'";
var maecennas = "ipsum 'dolor' sit \"amet\"";
```


## License

Released under the [MIT License](http://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/esformatter-quotes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
