Skip to content

Instantly share code, notes, and snippets.

@zhenyong
Last active July 25, 2017 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhenyong/6303b2ccfb365c50ef16c0e48a86877e to your computer and use it in GitHub Desktop.
Save zhenyong/6303b2ccfb365c50ef16c0e48a86877e to your computer and use it in GitHub Desktop.
Generate eslintrc (json) file since only .eslintrc files are supported (import formatter). And only rules present in the .eslintrc file. Extends are not supported.
const cp = require('child_process');
const fs = require('fs');
cp.exec('eslint --print-config ./eslintrc.js', {}, (err, stdout, stderr) => {
if (stderr) {
console.log(stderr);
return;
}
fs.writeFileSync('./.eslintrc', stdout);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment