# esformatter-semicolon-first

> esformatter plugin: add semicolon before '[' and '(' if it's the start of a line.

Latest version **1.2.0** (published 2016-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install esformatter-semicolon-first
pnpm add esformatter-semicolon-first
yarn add esformatter-semicolon-first
bun add esformatter-semicolon-first
```

## 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.2.0 |
| Published | 2016-08-07 |
| First published | 2015-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Miller Medeiros |
| Maintainers | millermedeiros |
| Keywords | esformatter, esformatter-plugin, string, quotes, AST |

## Links

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

## Dependencies (4)

- [rocambole](https://npm.io/package/rocambole.md) >=0.6.0 <2.0
- [rocambole-token](https://npm.io/package/rocambole-token.md) ^1.2.1
- [esformatter-parser](https://npm.io/package/esformatter-parser.md) ^1.0
- [rocambole-linebreak](https://npm.io/package/rocambole-linebreak.md) ^1.0.2

## 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.2.0 (latest) — 2016-08-07
- 1.1.0 — 2015-06-26
- 1.0.1 — 2015-03-25
- 1.0.0 — 2015-03-24

## README

# esformatter-semicolon-first

[esformatter](https://github.com/millermedeiros/esformatter) plugin to add
semicolon before `[` and `(` if they are the first things on the line.

created mainly to be used by [standard-format](https://github.com/maxogden/standard-format)

## Usage

Add to your esformatter config file:

```json
{
  "plugins": [
    "esformatter-semicolon-first"
  ]
}
```

Or you can manually register the plugin if not using `esformatter` directly:

```js
// register plugin
esformatter.register(require('esformatter-semicolon-first'));
```

# Config

By default we add at least one line break before the semicolon and remove line
breaks afterwards, but you can use the
`lineBreak.before['esformatter-semicolon-first']` and
`lineBreak.after['esformatter-semicolon-first']` to configure it tho.

```json
{
  "lineBreak": {
    "before": {
      "esformatter-semicolon-first": ">0"
    },
    "after": {
      "esformatter-semicolon-first": 0
    }
  }
}
```

## Examples

Given this input program:

```js
var x = 2
[1,2,3].map(function() {})

var y = 8
(function() {
  bar()
}())
```

It will output:

```js
var x = 2
;[1,2,3].map(function() {})

var y = 8
;(function() {
  bar()
}())
```

For more examples see the test files inside the `test/` folder.

## License

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

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