Skip to content

Commit

Permalink
Moved Babel and ESLint config to package.json after ejecting (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
montogeek authored and gaearon committed Sep 27, 2016
1 parent 37819ee commit d72c749
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ prompt(
var ownPath = path.join(__dirname, '..');
var appPath = path.join(ownPath, '..', '..');
var files = [
'.babelrc',
'.eslintrc',
path.join('config', 'env.js'),
path.join('config', 'paths.js'),
path.join('config', 'polyfills.js'),
Expand Down Expand Up @@ -76,6 +74,8 @@ prompt(

var ownPackage = require(path.join(ownPath, 'package.json'));
var appPackage = require(path.join(appPath, 'package.json'));
var babelConfig = JSON.parse(fs.readFileSync(path.join(ownPath, '.babelrc'), 'utf8'));
var eslintConfig = JSON.parse(fs.readFileSync(path.join(ownPath, '.eslintrc'), 'utf8'));

var ownPackageName = ownPackage.name;
console.log('Removing dependency: ' + ownPackageName);
Expand Down Expand Up @@ -104,6 +104,12 @@ prompt(
true
);

// Add Babel config
appPackage.babel = babelConfig;

// Add ESlint config
appPackage.eslintConfig = eslintConfig;

console.log('Writing package.json');
fs.writeFileSync(
path.join(appPath, 'package.json'),
Expand Down

0 comments on commit d72c749

Please sign in to comment.