diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index ebb18e94002..2308496a692 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,2 +1,2 @@
-packages/ @amyrlam @bugzpodder @gaearon @ianschmitz @iansu @mrmckeb @petetnt @timer
+packages/ @bugzpodder @ianschmitz @iansu @mrmckeb @petetnt
docusaurus/ @amyrlam @iansu
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index ef59c777e7e..ac2eebaa4b9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
-labels: "issue: bug"
+labels: 'issue: bug, needs triage'
---
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
new file mode 100644
index 00000000000..147ea1dc458
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -0,0 +1,13 @@
+---
+name: Question
+about: Get help with Create React App
+labels: 'needs triage'
+---
+
+If you have a general question about Create React App or about building an app with Create React App we encourage you to post on our Spectrum community instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://spectrum.chat/create-react-app
+
+If you're looking for general information on using React, the React docs have a list of resources: https://reactjs.org/community/support.html
+
+If you've discovered a bug or would like to propose a change please use one of the other issue templates.
+
+Thanks!
diff --git a/CHANGELOG-1.x.md b/CHANGELOG-1.x.md
index ae2725af297..be64a067a8c 100644
--- a/CHANGELOG-1.x.md
+++ b/CHANGELOG-1.x.md
@@ -482,7 +482,7 @@ yarn add --exact react-scripts@1.0.16
- [#3150](https://github.com/facebook/create-react-app/pull/3150) Remove an useless negation in `registerServiceWorker.js`. ([@dunglas](https://github.com/dunglas))
- [#3158](https://github.com/facebook/create-react-app/pull/3158) Remove `output.path` from dev webpack config. ([@nikolas](https://github.com/nikolas))
- - [#3281](https://github.com/facebook/create-react-app/pull/3281) Add a workaround for Uglify incompatiblity with Safari 10.0 in the future. ([@satyavh](https://github.com/satyavh))
+ - [#3281](https://github.com/facebook/create-react-app/pull/3281) Add a workaround for Uglify incompatibility with Safari 10.0 in the future. ([@satyavh](https://github.com/satyavh))
- [#3146](https://github.com/facebook/create-react-app/pull/3146) Fix `reason-react` support. ([@lpalmes](https://github.com/lpalmes))
- [#3236](https://github.com/facebook/create-react-app/pull/3236) Update `style-loader` and disable inclusion of its HMR code in builds. ([@insin](https://github.com/insin))
- [#3246](https://github.com/facebook/create-react-app/pull/3246) Update `url-loader` to 0.6.2 for mime ReDoS vulnerability. ([@d3viant0ne](https://github.com/d3viant0ne))
@@ -1443,7 +1443,7 @@ yarn add --dev --exact react-scripts@1.0.1
## 1.0.0 (May 18, 2017)
-We’ve been working on this release for the past few months, and there are many big impovements, from migrating to webpack 2 to a brand new runtime error overlay and built-in support for Progressive Web Apps.
+We’ve been working on this release for the past few months, and there are many big improvements, from migrating to webpack 2 to a brand new runtime error overlay and built-in support for Progressive Web Apps.
So instead of just enumerating them here, we decided to write a blog post about all the new features.
Check it out: **[What’s New in Create React App](https://facebook.github.io/react/blog/2017/05/18/whats-new-in-create-react-app.html)**.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 76e704dacb1..95782952f67 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -135,8 +135,8 @@ By default git would use `CRLF` line endings which would cause the scripts to fa
## Cutting a Release
-1. Tag all merged pull requests that go into the release with the relevant milestone. Each merged PR should also be labeled with one of the [labels](https://github.com/facebook/create-react-app/labels) named `tag: ...` to indicate what kind of change it is.
-2. Close the milestone.
+1. Tag all merged pull requests that go into the release with the relevant milestone. Each merged PR should also be labeled with one of the [labels](https://github.com/facebook/create-react-app/labels) named `tag: ...` to indicate what kind of change it is. **Make sure all breaking changes are correctly labelled with `tag: breaking change`.**
+2. Close the milestone and create a new one for the next release.
3. In most releases, only `react-scripts` needs to be released. If you don’t have any changes to the `packages/create-react-app` folder, you don’t need to bump its version or publish it (the publish script will publish only changed packages).
4. Note that files in `packages/create-react-app` should be modified with extreme caution. Since it’s a global CLI, any version of `create-react-app` (global CLI) including very old ones should work with the latest version of `react-scripts`.
5. Run `yarn compile:lockfile`. The command will generate an updated lockfile in `packages/create-react-app` that should be committed.
@@ -152,7 +152,14 @@ By default git would use `CRLF` line endings which would cause the scripts to fa
9. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
10. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
-Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- prepatch --canary --preid next --dist-tag next --npm-client npm --force-publish` instead of `npm run publish`.
+Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --canary=next --exact --cd-version --npm-tag=next` instead of `npm run publish`.
+
+## Releasing the Docs
+
+1. Go to the `docusaurus/website` directory
+2. Run `yarn build`
+3. You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."`
+4. Run `GIT_USER= CURRENT_BRANCH=master USE_SSH=true yarn run publish-gh-pages`
---
diff --git a/README.md b/README.md
index 347d4359760..f499fdd49f6 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ Just create a project, and you’re good to go.
## Creating an App
-**You’ll need to have Node 8.10.0 or later on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
+**You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
To create a new app, you may choose one of the following methods:
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index c51be42da86..1f770cc7105 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -12,7 +12,7 @@ variables:
NPM_CONFIG_CACHE: $(Build.SourcesDirectory)/../npm-cache
# Sets TEMP to be on the same drive as the cloned source on Windows. This avoids test scripts that "cd" into a directory under TEMP from failing because this directory is on a different drive from the current directory.
VSTS_OVERWRITE_TEMP: True
- # Override Verdaccio package to use. This is temoporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout.
+ # Override Verdaccio package to use. This is temporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout.
VERDACCIO_PACKAGE: https://github.com/willsmythe/verdaccio/releases/download/create-react-app/verdaccio-4.0.0-alpha.8.tgz
# ******************************************************************************
@@ -67,7 +67,7 @@ jobs:
# Old Node test suite
# ******************************************************************************
- job: OldNode
- pool:
+ pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
diff --git a/docusaurus/docs/adding-images-fonts-and-files.md b/docusaurus/docs/adding-images-fonts-and-files.md
index deb6cc39f89..92704ad1f58 100644
--- a/docusaurus/docs/adding-images-fonts-and-files.md
+++ b/docusaurus/docs/adding-images-fonts-and-files.md
@@ -59,3 +59,5 @@ const App = () => (
```
This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is special and tells Create React App that you want a React component that renders an SVG, rather than its filename.
+
+> **Tip:** The imported SVG React Component accepts a `title` prop along with other props that a `svg` element accepts. Use this prop to add an accessbile title to your svg component.
diff --git a/docusaurus/docs/advanced-configuration.md b/docusaurus/docs/advanced-configuration.md
index 9799a1ad403..ab51e951b03 100644
--- a/docusaurus/docs/advanced-configuration.md
+++ b/docusaurus/docs/advanced-configuration.md
@@ -22,3 +22,4 @@ You can adjust various development and production settings by setting environmen
| NODE_PATH | ✅ Used | ✅ Used | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`. |
| INLINE_RUNTIME_CHUNK | 🚫 Ignored | ✅ Used | By default, Create React App will embed the runtime script into `index.html` during the production build. When set to `false`, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP. |
| IMAGE_INLINE_SIZE_LIMIT | 🚫 Ignored | ✅ Used | By default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes. Setting it to 0 will disable the inlining of images. |
+| EXTEND_ESLINT | ✅ Used | ✅ Used | When set to `true`, ESLint configs that extend `eslint-config-react-app` will be used by `eslint-loader`. Any rules that are set to `"error"` will stop the application from building. |
diff --git a/docusaurus/docs/code-splitting.md b/docusaurus/docs/code-splitting.md
index ace13fdfcce..4c453f4a638 100644
--- a/docusaurus/docs/code-splitting.md
+++ b/docusaurus/docs/code-splitting.md
@@ -5,7 +5,7 @@ title: Code Splitting
Instead of downloading the entire app before users can use it, code splitting allows you to split your code into small chunks which you can then load on demand.
-This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 3. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module.
+This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 4. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module.
Here is an example:
diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md
index e166c71dfd0..e33a4bf27f2 100644
--- a/docusaurus/docs/running-tests.md
+++ b/docusaurus/docs/running-tests.md
@@ -111,8 +111,6 @@ import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
```
-> Note: When using TypeScript with Babel, all your files need to have at least one export, otherwise you will get the error `Cannot compile namespaces when the '--isolatedModules' flag is provided.`. To fix this, you can add `export default undefined` to `src/setupTests.ts`.
-
> Note: Keep in mind that if you decide to "eject" before creating `src/setupTests.js`, the resulting `package.json` file won't contain any reference to it. [Read here](#initializing-test-environment) to learn how to add this after ejecting.
Now you can write a smoke test with it:
diff --git a/docusaurus/docs/setting-up-your-editor.md b/docusaurus/docs/setting-up-your-editor.md
index 869592d2915..844b9bc5da2 100644
--- a/docusaurus/docs/setting-up-your-editor.md
+++ b/docusaurus/docs/setting-up-your-editor.md
@@ -18,15 +18,7 @@ To configure the syntax highlighting in your favorite text editor, head to the [
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
-They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.
-
-You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc.json` to the project root:
-
-```json
-{
- "extends": "react-app"
-}
-```
+They are not required for linting. You should see the linter output right in your terminal as well as the browser console. If you prefer the lint results to appear right in your editor, please make sure you install an ESLint plugin/extension.
If you're using TypeScript and Visual Studio Code, the [ESLint Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint#overview) currently [doesn't have TypeScript support enabled by default](https://github.com/Microsoft/vscode-eslint/issues/609). To enable TypeScript support in the ESLint extension, add the following to your project's Visual Studio Code settings file, located at `.vscode/settings.json` (you can create this file if it doesn't already exist):
@@ -43,10 +35,46 @@ If you're using TypeScript and Visual Studio Code, the [ESLint Visual Studio Cod
Now your editor should report the linting warnings.
-Note that even if you edit your `.eslintrc.json` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
+Note that even if you customise your ESLint config, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
If you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules.
+### Experimental: Extending the ESLint config
+
+We recognise that in some cases, further customisation is required. It is now possible to extend the base ESLint config by setting the `EXTEND_ESLINT` environment variable to `true`. See [advanced configuration](advanced-configuration.md) for more information on available environment variables.
+
+Note that any rules set to `"error"` will stop the project from building.
+
+There are a few things to remember:
+
+1. You must extend the base config, as removing it could introduce hard-to-find issues.
+1. When working with TypeScript, you'll need to provide an `overrides` object for rules that should _only_ target TypeScript files.
+
+In the below example:
+
+- the base config has been extended by a shared ESLint config,
+- a new rule has been set that applies to all JavaScript and TypeScript files, and
+- a new rule has been set that only targets TypeScript files.
+
+```json
+{
+ "eslintConfig": {
+ "extends": ["react-app", "shared-config"],
+ "rules": {
+ "additional-rule": "warn"
+ },
+ "overrides": [
+ {
+ "files": ["**/*.ts?(x)"],
+ "rules": {
+ "additional-typescript-only-rule": "warn"
+ }
+ }
+ ]
+ }
+}
+```
+
## Debugging in the Editor
**This feature is currently only supported by [Visual Studio Code](https://code.visualstudio.com) and [WebStorm](https://www.jetbrains.com/webstorm/).**
diff --git a/package.json b/package.json
index 9763ceec6a6..081973184bb 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"compile:lockfile": "node tasks/compile-lockfile.js"
},
"devDependencies": {
- "eslint": "5.16.0",
+ "eslint": "6.1.0",
"execa": "1.0.0",
"fs-extra": "^7.0.1",
"get-port": "^4.2.0",
diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js
index c06cfabfb43..bc5ff12f4c3 100644
--- a/packages/eslint-config-react-app/index.js
+++ b/packages/eslint-config-react-app/index.js
@@ -54,7 +54,7 @@ module.exports = {
overrides: [
{
- files: ['**/*.ts', '**/*.tsx'],
+ files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
@@ -163,7 +163,9 @@ module.exports = {
'no-obj-calls': 'warn',
'no-octal': 'warn',
'no-octal-escape': 'warn',
- 'no-redeclare': 'warn',
+ // TODO: Remove this option in the next major release of CRA.
+ // https://eslint.org/docs/user-guide/migrating-to-6.0.0#-the-no-redeclare-rule-is-now-more-strict-by-default
+ 'no-redeclare': ['warn', { builtinGlobals: false }],
'no-regex-spaces': 'warn',
'no-restricted-syntax': ['warn', 'WithStatement'],
'no-script-url': 'warn',
@@ -249,7 +251,7 @@ module.exports = {
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
'react/jsx-no-comment-textnodes': 'warn',
- 'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
+ 'react/jsx-no-duplicate-props': 'warn',
'react/jsx-no-target-blank': 'warn',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': [
diff --git a/packages/eslint-config-react-app/package.json b/packages/eslint-config-react-app/package.json
index 43f700771d2..b752f4937a6 100644
--- a/packages/eslint-config-react-app/package.json
+++ b/packages/eslint-config-react-app/package.json
@@ -18,8 +18,8 @@
"@typescript-eslint/eslint-plugin": "1.x",
"@typescript-eslint/parser": "1.x",
"babel-eslint": "10.x",
- "eslint": "5.x",
- "eslint-plugin-flowtype": "2.x",
+ "eslint": "6.x",
+ "eslint-plugin-flowtype": "3.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-react": "7.x",
diff --git a/packages/react-dev-utils/WebpackDevServerUtils.js b/packages/react-dev-utils/WebpackDevServerUtils.js
index 1d7021e037c..8d74e8cf131 100644
--- a/packages/react-dev-utils/WebpackDevServerUtils.js
+++ b/packages/react-dev-utils/WebpackDevServerUtils.js
@@ -361,10 +361,14 @@ function prepareProxy(proxy, appPublicFolder) {
process.exit(1);
}
- // If proxy is specified, let it handle any request except for files in the public folder.
+ // If proxy is specified, let it handle any request except for
+ // files in the public folder and requests to the WebpackDevServer socket endpoint.
+ // https://github.com/facebook/create-react-app/issues/6720
function mayProxy(pathname) {
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1));
- return !fs.existsSync(maybePublicPath);
+ const isPublicFileRequest = fs.existsSync(maybePublicPath);
+ const isWdsEndpointRequest = pathname.startsWith('/sockjs-node'); // used by webpackHotDevClient
+ return !(isPublicFileRequest || isWdsEndpointRequest);
}
if (!/^http(s)?:\/\//.test(proxy)) {
diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json
index 985a1e9b5dd..356defb8a98 100644
--- a/packages/react-error-overlay/package.json
+++ b/packages/react-error-overlay/package.json
@@ -37,19 +37,19 @@
"@babel/code-frame": "7.0.0",
"@babel/core": "7.4.3",
"anser": "1.4.8",
- "babel-eslint": "10.0.1",
+ "babel-eslint": "10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "8.0.5",
"babel-preset-react-app": "^9.0.0",
"chalk": "^2.4.2",
"chokidar": "^2.1.2",
"cross-env": "5.2.0",
- "eslint": "^5.16.0",
+ "eslint": "^6.1.0",
"eslint-config-react-app": "^4.0.1",
- "eslint-plugin-flowtype": "2.50.1",
- "eslint-plugin-import": "2.16.0",
- "eslint-plugin-jsx-a11y": "6.2.1",
- "eslint-plugin-react": "7.12.4",
+ "eslint-plugin-flowtype": "3.12.1",
+ "eslint-plugin-import": "2.18.2",
+ "eslint-plugin-jsx-a11y": "6.2.3",
+ "eslint-plugin-react": "7.14.3",
"flow-bin": "^0.63.1",
"html-entities": "1.2.1",
"jest": "24.7.1",
diff --git a/packages/react-error-overlay/src/utils/unmapper.js b/packages/react-error-overlay/src/utils/unmapper.js
index c61fad4fb6c..4c95ab4d7b3 100644
--- a/packages/react-error-overlay/src/utils/unmapper.js
+++ b/packages/react-error-overlay/src/utils/unmapper.js
@@ -12,7 +12,7 @@ import { getLinesAround } from './getLinesAround';
import path from 'path';
function count(search: string, string: string): number {
- // Count starts at -1 becuse a do-while loop always runs at least once
+ // Count starts at -1 because a do-while loop always runs at least once
let count = -1,
index = -1;
do {
diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js
index 771b06c94d1..4b62f3d8a28 100644
--- a/packages/react-scripts/config/webpack.config.js
+++ b/packages/react-scripts/config/webpack.config.js
@@ -33,6 +33,7 @@ const getClientEnvironment = require('./env');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
+const eslint = require('eslint');
// @remove-on-eject-begin
const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
// @remove-on-eject-end
@@ -197,7 +198,7 @@ module.exports = function(webpackEnv) {
terserOptions: {
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
- // to apply any minfication steps that turns valid ecma 5 code
+ // to apply any minification steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
@@ -213,7 +214,7 @@ module.exports = function(webpackEnv) {
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
- // Pending futher investigation:
+ // Pending further investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
@@ -322,10 +323,32 @@ module.exports = function(webpackEnv) {
options: {
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
+ resolvePluginsRelativeTo: __dirname,
// @remove-on-eject-begin
- baseConfig: {
- extends: [require.resolve('eslint-config-react-app')],
- },
+ baseConfig: (() => {
+ const eslintCli = new eslint.CLIEngine();
+ let eslintConfig;
+ try {
+ eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs);
+ } catch (e) {
+ // A config couldn't be found.
+ }
+
+ // We allow overriding the config, only if it extends our config
+ // (`extends` can be a string or array of strings).
+ if (
+ process.env.EXTEND_ESLINT &&
+ eslintConfig &&
+ eslintConfig.extends &&
+ eslintConfig.extends.includes('react-app')
+ ) {
+ return eslintConfig;
+ } else {
+ return {
+ extends: [require.resolve('eslint-config-react-app')],
+ };
+ }
+ })(),
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
@@ -388,7 +411,8 @@ module.exports = function(webpackEnv) {
{
loaderMap: {
svg: {
- ReactComponent: '@svgr/webpack?-svgo,+ref![path]',
+ ReactComponent:
+ '@svgr/webpack?-svgo,+titleProp,+ref![path]',
},
},
},
diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json
index af92d8ab28b..269a93ddf5e 100644
--- a/packages/react-scripts/package.json
+++ b/packages/react-scripts/package.json
@@ -29,10 +29,10 @@
"types": "./lib/react-app.d.ts",
"dependencies": {
"@babel/core": "7.4.3",
- "@svgr/webpack": "4.2.0",
- "@typescript-eslint/eslint-plugin": "1.10.2",
- "@typescript-eslint/parser": "1.10.2",
- "babel-eslint": "10.0.1",
+ "@svgr/webpack": "4.3.1",
+ "@typescript-eslint/eslint-plugin": "1.13.0",
+ "@typescript-eslint/parser": "1.13.0",
+ "babel-eslint": "10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "8.0.5",
"babel-plugin-named-asset-import": "^0.3.2",
@@ -42,14 +42,14 @@
"css-loader": "2.1.1",
"dotenv": "6.2.0",
"dotenv-expand": "4.2.0",
- "eslint": "^5.16.0",
+ "eslint": "^6.1.0",
"eslint-config-react-app": "^4.0.1",
- "eslint-loader": "2.1.2",
- "eslint-plugin-flowtype": "2.50.1",
- "eslint-plugin-import": "2.16.0",
- "eslint-plugin-jsx-a11y": "6.2.1",
- "eslint-plugin-react": "7.12.4",
- "eslint-plugin-react-hooks": "^1.5.0",
+ "eslint-loader": "2.2.1",
+ "eslint-plugin-flowtype": "3.12.1",
+ "eslint-plugin-import": "2.18.2",
+ "eslint-plugin-jsx-a11y": "6.2.3",
+ "eslint-plugin-react": "7.14.3",
+ "eslint-plugin-react-hooks": "^1.6.1",
"file-loader": "3.0.1",
"fs-extra": "7.0.1",
"html-webpack-plugin": "4.0.0-beta.5",
@@ -75,7 +75,7 @@
"style-loader": "0.23.1",
"terser-webpack-plugin": "1.2.3",
"ts-pnp": "1.1.2",
- "url-loader": "1.1.2",
+ "url-loader": "2.0.1",
"webpack": "4.35.0",
"webpack-dev-server": "3.2.1",
"webpack-manifest-plugin": "2.0.4",
diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js
index 7bad09e513c..2a494ffe24f 100644
--- a/packages/react-scripts/scripts/eject.js
+++ b/packages/react-scripts/scripts/eject.js
@@ -239,10 +239,12 @@ inquirer
};
// Add ESlint config
- console.log(` Adding ${cyan('ESLint')} configuration`);
- appPackage.eslintConfig = {
- extends: 'react-app',
- };
+ if (!appPackage.eslintConfig) {
+ console.log(` Adding ${cyan('ESLint')} configuration`);
+ appPackage.eslintConfig = {
+ extends: 'react-app',
+ };
+ }
fs.writeFileSync(
path.join(appPath, 'package.json'),
diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js
index 32c93da5ae3..010bc2904a9 100644
--- a/packages/react-scripts/scripts/test.js
+++ b/packages/react-scripts/scripts/test.js
@@ -57,7 +57,8 @@ function isInMercurialRepository() {
// Watch unless on CI or explicitly running all tests
if (
!process.env.CI &&
- argv.indexOf('--watchAll') === -1
+ argv.indexOf('--watchAll') === -1 &&
+ argv.indexOf('--watchAll=false') === -1
) {
// https://github.com/facebook/create-react-app/issues/5210
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js
index 8d37500d1ab..2ce0e5856f8 100644
--- a/packages/react-scripts/scripts/utils/createJestConfig.js
+++ b/packages/react-scripts/scripts/utils/createJestConfig.js
@@ -84,15 +84,15 @@ module.exports = (resolve, rootDir, isEjecting) => {
];
if (overrides) {
supportedKeys.forEach(key => {
- if (overrides.hasOwnProperty(key)) {
- if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
+ if (Object.prototype.hasOwnProperty.call(overrides, key)) {
+ if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
// for arrays or primitive types, directly override the config key
- config[key] = overrides[key];
+ config[key] = overrides[key];
} else {
// for object types, extend gracefully
- config[key] = Object.assign({}, config[key], overrides[key]);
- }
-
+ config[key] = Object.assign({}, config[key], overrides[key]);
+ }
+
delete overrides[key];
}
});
diff --git a/tasks/e2e-installs.sh b/tasks/e2e-installs.sh
index 27577cdef0d..f083f2dd09b 100755
--- a/tasks/e2e-installs.sh
+++ b/tasks/e2e-installs.sh
@@ -213,7 +213,7 @@ exists node_modules/react-scripts-fork
# ******************************************************************************
cd "$temp_app_path"
-# we will install a non-existing package to simulate a failed installataion.
+# we will install a non-existing package to simulate a failed installation.
npx create-react-app test-app-should-not-exist --scripts-version=`date +%s` || true
# confirm that the project files were deleted
test ! -e test-app-should-not-exist/package.json
@@ -226,7 +226,7 @@ test ! -d test-app-should-not-exist/node_modules
cd "$temp_app_path"
mkdir test-app-should-remain
echo '## Hello' > ./test-app-should-remain/README.md
-# we will install a non-existing package to simulate a failed installataion.
+# we will install a non-existing package to simulate a failed installation.
npx create-react-app test-app-should-remain --scripts-version=`date +%s` || true
# confirm the file exist
test -e test-app-should-remain/README.md
diff --git a/tasks/local-registry.sh b/tasks/local-registry.sh
index 715380a8a85..f19a73c4ca3 100644
--- a/tasks/local-registry.sh
+++ b/tasks/local-registry.sh
@@ -25,9 +25,6 @@ function stopLocalRegistry {
# Restore the original NPM and Yarn registry URLs and stop Verdaccio
npm set registry "$original_npm_registry_url"
yarn config set registry "$original_yarn_registry_url"
-
- # Kill Verdaccio process
- ps -ef | grep 'verdaccio' | grep -v grep | awk '{print $2}' | xargs kill -9
}
function publishToLocalRegistry {