Skip to content

kmkzt/eslint-formatter-skip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-formatter-skip

eslint-formatter-skip is library that adds eslint-disable comments for each file that cannot be automatically fix by eslint. This is useful when you get a lot of errors after changing the rules, updating versions, add plugins.

Install

yarn add -D eslint-formatter-skip
# or
# npm i -save-dev eslint-formatter-skip

Usage

Please be careful as the file will be overwritten

yarn eslint -f skip src

Example

Example code.

// ./testdata/index.js
var x; // error: unused-vars

var b = "b";
var ab = "a" + b; // error: prefer-template
console.log(ab);

eslint rules.

// ./testdata/.eslintrc.js
module.exports = {
  parserOptions: {
    ecmaVersion: 2015,
  },
  rules: {
    "no-unused-vars": ["error"],
    "prefer-template": ["error"],
  },
};

With autofix. yarn eslint -f skip --fix ./testdata

/* eslint-disable no-unused-vars */
var x; // error: unused-vars

var b = "b";
var ab = `a${  b}`; // error: prefer-template
console.log(ab);

Without autofix. yarn eslint -f skip ./testdata

/* eslint-disable no-unused-vars, prefer-template */
var x; // error: unused-vars

var b = "b";
var ab = "a" + b; // error: prefer-template
console.log(ab);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published