diff --git a/packages/react-scripts/babelrc b/packages/react-scripts/babelrc deleted file mode 100644 index ad8e03a8248..00000000000 --- a/packages/react-scripts/babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["react-app"] -} \ No newline at end of file diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index c7948b66f6e..aea37eab6bc 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -19,11 +19,6 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM const getClientEnvironment = require('./env'); const paths = require('./paths'); -// @remove-on-eject-begin -// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174 -const path = require('path'); -// @remove-on-eject-end - // Webpack uses `publicPath` to determine where the app is being served from. // In development, we always serve from the root. This makes config easier. const publicPath = '/'; @@ -121,7 +116,9 @@ module.exports = { // @remove-on-eject-begin // Point ESLint to our predefined config. options: { - configFile: path.join(__dirname, '../eslintrc'), + baseConfig: { + extends: ['react-app'], + }, useEslintrc: false, }, // @remove-on-eject-end diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 979ed4e4d6d..218eb46bb0c 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -19,11 +19,6 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const paths = require('./paths'); const getClientEnvironment = require('./env'); -// @remove-on-eject-begin -// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174 -const path = require('path'); -// @remove-on-eject-end - // Webpack uses `publicPath` to determine where the app is being served from. // It requires a trailing slash, or the file assets will get an incorrect path. const publicPath = paths.servedPath; @@ -122,7 +117,9 @@ module.exports = { options: { // TODO: consider separate config for production, // e.g. to enable no-console and no-debugger only in production. - configFile: path.join(__dirname, '../eslintrc'), + baseConfig: { + extends: ['react-app'], + }, useEslintrc: false, }, // @remove-on-eject-end diff --git a/packages/react-scripts/eslintrc b/packages/react-scripts/eslintrc deleted file mode 100644 index 5e603ecd193..00000000000 --- a/packages/react-scripts/eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "react-app" -} diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 59542d4361d..b2cb03bb972 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -11,8 +11,6 @@ "url": "https://github.com/facebookincubator/create-react-app/issues" }, "files": [ - "babelrc", - "eslintrc", "bin", "config", "scripts", diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 68c43d25068..8edc441002e 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -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'),