Last active
July 25, 2017 04:16
-
-
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.
This file contains hidden or 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
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