eslint-ignore-inserter
When moving to a new ESLint config, or when adopting ESLint for the first time, it's common to have tons of violations that you want to silence for now.
Last updated 2 years ago by stevenpetryk .
MIT · Original npm · Tarball · package.json
$ cnpm install eslint-ignore-inserter 
SYNC missed versions from official npm registry.

eslint-ignore-inserter

When moving to a new ESLint config, or when adopting ESLint for the first time, it's common to have tons of violations that you want to silence for now.

This library exposes a helpful utility, eslint-ignore-inserter, that will do all the heavy lifting, and insert // eslint-ignore-next-line ... comments into your code.

Example (Before/After)

Say you have the following code, with an indentation violation:

function example () {
  console.log('Hello')
    console.log('World!')
}

Assuming you have the ESLint indent rule turned on, running this...

eslint --format json . | eslint-ignore-inserter

... yields this:

function example () {
  console.log('Hello')
    // eslint-disable-next-line indent
    console.log('World!')
}

Installation

$ yarn add --dev eslint-ignore-inserter

Then, in your package.json, you can do something like this:

{
  "scripts": {
    "eslint:insert-ignores": "eslint --format json . | eslint-ignore-inserter"
  }
}

Alternatively, you can install it globally and do the piping in your shell.

Previewing your changes

The --dry-run / -d flag will prevent any filesystem writes, and will instead print the modified files to stdout for you to inspect.

License

MIT

Current Tags

  • 0.1.2                                ...           latest (2 years ago)

3 Versions

  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 3
Last Day 1
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |