0.1.0 • Published 8 years ago
add-eslint-comment v0.1.0
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 -gGenerate ESLint Result JSON
eslint -f json src > eslint-result.jsonThis 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.jsonHave fun with add-eslint-comment!
0.1.0
8 years ago