Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-ignore-inserter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 03 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc