Fixes a silent crash when ejecting (#1810)

* Fixes a silent crash when ejecting

* Delete unnecessary files

* Remove references to eslintrc in Webpack config

* Fix lint

* Correct ESLint CLI options
This commit is contained in:
Dan Abramov
2017-03-14 15:17:53 +00:00
committed by Joe Haddad
parent b55a7d80f2
commit ccb5f84dc6
6 changed files with 12 additions and 28 deletions

View File

@@ -100,12 +100,6 @@ prompt(
const ownPackage = require(path.join(ownPath, 'package.json'));
const appPackage = require(path.join(appPath, 'package.json'));
const babelConfig = JSON.parse(
fs.readFileSync(path.join(ownPath, '.babelrc'), 'utf8')
);
const eslintConfig = JSON.parse(
fs.readFileSync(path.join(ownPath, '.eslintrc'), 'utf8')
);
console.log(cyan('Updating the dependencies'));
const ownPackageName = ownPackage.name;
@@ -154,11 +148,15 @@ prompt(
// Add Babel config
console.log(` Adding ${cyan('Babel')} preset`);
appPackage.babel = babelConfig;
appPackage.babel = {
presets: ['react-app'],
};
// Add ESlint config
console.log(` Adding ${cyan('ESLint')} configuration`);
appPackage.eslintConfig = eslintConfig;
appPackage.eslintConfig = {
extends: 'react-app',
};
fs.writeFileSync(
path.join(appPath, 'package.json'),