New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

add-eslint-comment

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-eslint-comment

Add ESLint comment per file according to the ESLint result.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50
increased by4.17%
Maintainers
1
Weekly downloads
 
Created
Source

Add ESLint Comment

Every time when I trying to add ESLint to an old project, it's painful to fix errors like eqeqeq or no-var.

One way is to enable these rules and add eslint comment to the old files to prevent new files breaking these rules.

This is what this tool can do.

Add ESLint comment per file according to the ESLint result.

Before:

var foo;
if (foo == 1) {
    alert(foo);
}

After:

/* eslint no-var:0 */
/* eslint no-alert:0 */
/* eslint eqeqeq:0 */
var foo;
if (foo == 1) {
    alert(foo);
}

Getting Started

Installation

npm install add-eslint-comment -g

Generate ESLint Result JSON

eslint -f json src > eslint-result.json

This will lint your src directory, formatter the result to json, and output into eslint-result.json file.

Checkout the documentation for more details.

Add ESLint Comment per file

add-eslint-comment -j eslint-result.json

Have fun with add-eslint-comment!

Keywords

FAQs

Package last updated on 11 Aug 2017

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