From 63e8924f993891c0e92c8b072830735f0f181135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84=C2=90inh=20Quang=20Trung?= Date: Fri, 7 Jul 2017 17:40:29 +0700 Subject: [PATCH] ESLint 4 (#2735) * Update eslint-loader 1.7.1 -> 1.9.0 * Add eslintPath option * Update eslint 3.19.0 -> 4.1.1 * Update peer dependencies * Move eslintPath config to outside @remove-on-eject --- packages/eslint-config-react-app/package.json | 2 +- packages/react-scripts/config/webpack.config.dev.js | 12 +++--------- packages/react-scripts/config/webpack.config.prod.js | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/eslint-config-react-app/package.json b/packages/eslint-config-react-app/package.json index cd36a70e5..559e78b25 100644 --- a/packages/eslint-config-react-app/package.json +++ b/packages/eslint-config-react-app/package.json @@ -12,7 +12,7 @@ ], "peerDependencies": { "babel-eslint": "^7.2.3", - "eslint": "^3.19.0", + "eslint": "^4.1.1", "eslint-plugin-flowtype": "^2.33.0", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^5.0.3", diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 2934aeae6..97d7012cc 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -162,14 +162,8 @@ module.exports = { { exclude: [ /\.html$/, - // We have to write /\.(js|jsx)(\?.*)?$/ rather than just /\.(js|jsx)$/ - // because you might change the hot reloading server from the custom one - // to Webpack's built-in webpack-dev-server/client?/, which would not - // get properly excluded by /\.(js|jsx)$/ because of the query string. - // Webpack 2 fixes this, but for now we include this hack. - // https://github.com/facebookincubator/create-react-app/issues/1713 - /\.(js|jsx)(\?.*)?$/, - /\.(ts|tsx)(\?.*)?$/, + /\.(js|jsx)$/, + /\.(ts|tsx)$/, /\.css$/, /\.json$/, /\.bmp$/, @@ -237,7 +231,7 @@ module.exports = { ], }, // ** STOP ** Are you adding a new loader? - // Remember to add the new extension(s) to the "url" loader exclusion list. + // Remember to add the new extension(s) to the "file" loader exclusion list. ], }, plugins: [ diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 8519c6603..0141675de 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -189,7 +189,7 @@ module.exports = { { test: /\.(ts|tsx)$/, include: paths.appSrc, - loader: require.resolve('ts-loader') + loader: require.resolve('ts-loader'), }, // The notation here is somewhat confusing. // "postcss" loader applies autoprefixer to our CSS.