Created
November 8, 2019 12:50
-
-
Save pubudu-ranasinghe/c4fed4767612601ee43eb4b8792f2488 to your computer and use it in GitHub Desktop.
airbnb eslint errors to warnings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import react from "../node_modules/eslint-config-airbnb-base/rules/strict.js"; | |
function isError(config) { | |
if(Array.isArray(config)) { | |
if(config[0] === 2 || config[0] === "error") { | |
return config; | |
} | |
} | |
if (config === 2 || config === "error") | |
return config; | |
return null; | |
} | |
let count = 0; | |
Object.keys(react.rules).forEach((k, i) => { | |
if(isError(react.rules[k])) { | |
count++ | |
console.log(`"${k}": "warn",`) | |
} | |
}) | |
console.log(count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment