Skip to content

Instantly share code, notes, and snippets.

@zpao
Last active April 14, 2016 21:44
Show Gist options
  • Save zpao/f7013c13715e666f0855bd706e4754c5 to your computer and use it in GitHub Desktop.
Save zpao/f7013c13715e666f0855bd706e4754c5 to your computer and use it in GitHub Desktop.
/**
* Finds rules that are supported by ESLint but not defined in our config.
*/
var ourRules = new Set(Object.keys(require('./.eslintrc.js').rules))
var supportedRules = new Set(Object.keys(require('./node_modules/eslint/lib/load-rules')()));
var missing = new Set();
var extra = new Set();
ourRules.forEach((rule) => {
if (!supportedRules.has(rule)) {
extra.add(rule);
}
});
supportedRules.forEach((rule) => {
if (!ourRules.has(rule)) {
missing.add(rule);
}
});
console.log('missing', missing);
console.log('extra', extra);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment