Skip to content

Commit 1d03579

Browse files
authoredOct 24, 2019
Add Alex to lint documentation (#7852)
* Add Alex to lint documentation * Attempt to trigger GitHub Action * Configure Alex and update docs * More docs updates
1 parent 4582491 commit 1d03579

25 files changed

+102
-63
lines changed
 

‎.alexignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
3+
CHANGELOG*
4+
CODE_OF_CONDUCT.md

‎.alexrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"allow": [
3+
"attacks",
4+
"colors",
5+
"conservative",
6+
"crashes",
7+
"executed",
8+
"executes",
9+
"execution",
10+
"failed",
11+
"hook",
12+
"host-hostess",
13+
"hostesses-hosts",
14+
"invalid",
15+
"remain",
16+
"watchman-watchwoman"
17+
]
18+
}

‎.github/workflows/lint.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Install
11+
run: yarn --no-progress --non-interactive --no-lockfile
12+
- name: Alex
13+
run: yarn alex

‎CONTRIBUTING.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Loving Create React App and want to get involved? Thanks! There are plenty of ways you can help.
44

5-
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
5+
Please take a moment to review this document in order to make the contribution process straightforward and effective for everyone involved.
66

77
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
88

@@ -15,23 +15,27 @@ Here are a few examples of them in action.
1515

1616
### Convention
1717

18+
<!--alex disable easy-->
19+
1820
Instead of letting the user specify the entry filename, we always assume it to be `src/index.js`. Rather than letting the user specify the output bundle name, we generate it, but make sure to include the content hash in it. Whenever possible, we want to leverage convention to make good choices for the user, especially in cases where it’s easy to misconfigure something.
1921

2022
### Heuristics
2123

2224
Normally, `npm start` runs on port `3000`, and this is not explicitly configurable. However, some environments like cloud IDEs want the programs to run on a specific port to serve their output. We want to play well with different environments, so Create React App reads `PORT` environment variable and prefers it when it is specified. The trick is that we know cloud IDEs already specify it automatically, so there is no need for the user to do anything. Create React App relies on heuristics to do the right thing depending on environment.
2325

26+
<!--alex disable just-->
27+
2428
Another example of this is how `npm test` normally launches the watcher, but if the `CI` environment variable is set, it will run tests once. We know that popular CI environments set this variable, so the user doesn’t need to do anything. It just works.
2529

2630
### Interactivity
2731

28-
We prefer to add interactivity to the command line interface rather than add configuration flags. For example, `npm start` will attempt to run with port `3000` by default, but it may be busy. Many other tools just fail in this case and ask that you pass a different port, but Create React App will display a prompt asking if you’d like to run the app on the next available port.
32+
We prefer to add interactivity to the command line interface rather than add configuration flags. For example, `npm start` will attempt to run with port `3000` by default, but it may be busy. Many other tools fail in this case and ask that you pass a different port, but Create React App will display a prompt asking if you’d like to run the app on the next available port.
2933

3034
Another example of interactivity is `npm test` watcher interface. Instead of asking people to pass command line flags for switching between test runner modes or search patterns, we print a hint with keys that you can press during the test session to instruct watcher what to do. Jest supports both flags and interactive CLI but Create React App prefers long-running sessions to keep user immersed in the flow over short-running sessions with different flags.
3135

3236
### Breaking the Rules
3337

34-
No rules are perfect. Sometimes we may introduce flags or configuration if we believe the value is high enough to justify the mental cost. For example, we know that apps may be hosted paths different from the root, and we need to support this use case. However, we still try to fall back to heuristics when possible. In this example, we ask that you specify `homepage` in `package.json`, and infer the correct path based on it. We also nudge the user to fill out the `homepage` after the build, so the user becomes aware that the feature exists.
38+
No rules are perfect. Sometimes we may introduce flags or configuration if we believe the value is high enough to justify the complexity. For example, we know that apps may be hosted paths different from the root, and we need to support this use case. However, we still try to fall back to heuristics when possible. In this example, we ask that you specify `homepage` in `package.json`, and infer the correct path based on it. We also nudge the user to fill out the `homepage` after the build, so the user becomes aware that the feature exists.
3539

3640
## Submitting a Pull Request
3741

@@ -76,7 +80,7 @@ This package is enabled by default for all `create-react-app` scaffolded applica
7680

7781
#### [react-dev-utils](https://github.com/facebook/create-react-app/tree/master/packages/react-dev-utils)
7882

79-
This package contains utilities used for `react-scripts` and sister packages.<br>
83+
This package contains utilities used for `react-scripts` and sibling packages.<br>
8084
Its main purpose is to conceal code which the user shouldn't be burdened with upon ejecting.
8185

8286
#### [react-scripts](https://github.com/facebook/create-react-app/tree/master/packages/react-scripts)
@@ -90,7 +94,7 @@ All functionality must be retained (and configuration given to the user) if they
9094

9195
2. Run `yarn` in the root `create-react-app` folder.
9296

93-
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` just like in a generated project.
97+
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` like you can in a generated project.
9498

9599
If you want to try out the end-to-end flow with the global CLI, you can do this too:
96100

@@ -113,7 +117,7 @@ More detailed information are in the dedicated [README](/packages/react-scripts/
113117

114118
#### Customizing E2E registry configuration
115119

116-
We use [verdaccio](https://github.com/verdaccio/verdaccio) to emulate packages publishing in a registry using a default configuration. You might modify the current behaviour just editing the file `task/verdaccio.yaml`.
120+
We use [verdaccio](https://github.com/verdaccio/verdaccio) to emulate packages publishing in a registry using a default configuration. You might modify the current behaviour by editing the file `task/verdaccio.yaml`.
117121

118122
For more information about the configuration check out the [Verdaccio documentation](https://verdaccio.org/docs/en/configuration).
119123

@@ -148,7 +152,7 @@ By default git would use `CRLF` line endings which would cause the scripts to fa
148152
- Maybe add some newlines here and there. Preview the result on GitHub to get a feel for it. Changelog generator output is a bit too terse for my taste, so try to make it visually pleasing and well grouped.
149153

150154
7. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them.
151-
8. Run `npm run publish`. (It has to be `npm run publish` exactly, not just `npm publish` or `yarn publish`.)
155+
8. Run `npm run publish`. (It has to be `npm run publish` exactly, not `npm publish` or `yarn publish`.)
152156
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.
153157
10. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
154158

‎README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ When you’re ready to deploy to production, create a minified bundle with `npm
3131
You **don’t** need to install or configure tools like Webpack or Babel.<br>
3232
They are preconfigured and hidden so that you can focus on the code.
3333

34-
Just create a project, and you’re good to go.
34+
Create a project, and you’re good to go.
3535

3636
## Creating an App
3737

38-
**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.
38+
**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 switch Node versions between different projects.
3939

4040
To create a new app, you may choose one of the following methods:
4141

@@ -86,7 +86,7 @@ my-app
8686
└── serviceWorker.js
8787
```
8888

89-
No configuration or complicated folder structures, just the files you need to build your app.<br>
89+
No configuration or complicated folder structures, only the files you need to build your app.<br>
9090
Once the installation is done, you can open your project folder:
9191

9292
```sh
@@ -133,7 +133,7 @@ Please refer to the [User Guide](https://facebook.github.io/create-react-app/doc
133133

134134
## Philosophy
135135

136-
- **One Dependency:** There is just one build dependency. It uses Webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.
136+
- **One Dependency:** There is only one build dependency. It uses Webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.
137137

138138
- **No Configuration Required:** You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.
139139

@@ -172,7 +172,7 @@ Here are a few common cases where you might want to try something else:
172172

173173
- If you need to **publish a React component**, [nwb](https://github.com/insin/nwb) can [also do this](https://github.com/insin/nwb#react-components-and-libraries), as well as [Neutrino's react-components preset](https://neutrino.js.org/packages/react-components/).
174174

175-
- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://github.com/zeit/next.js/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and just produces static HTML/JS/CSS bundles.
175+
- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://github.com/zeit/next.js/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles.
176176

177177
- If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) instead. Unlike Create React App, it pre-renders the website into HTML at the build time.
178178

‎docusaurus/docs/adding-custom-environment-variables.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Your project can consume variables declared in your environment as if they were
1212
>
1313
> Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files.
1414
15-
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, just like [described here](title-and-meta-tags.md#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
15+
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, as [described here](title-and-meta-tags.md#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
1616

1717
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid accidentally [exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.
1818
1919
These environment variables will be defined for you on `process.env`. For example, having an environment variable named `REACT_APP_NOT_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_NOT_SECRET_CODE`.
2020

21-
There is also a special built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
21+
There is also a built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
2222

2323
These environment variables can be useful for displaying information conditionally based on where the project is deployed or consuming sensitive data that lives outside of version control.
2424

‎docusaurus/docs/adding-images-fonts-and-files.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This works in CSS too:
3535
}
3636
```
3737

38-
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
38+
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
3939

4040
Please be advised that this is also a custom feature of Webpack.
4141

@@ -59,6 +59,6 @@ const App = () => (
5959
);
6060
```
6161

62-
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.
62+
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 significant and tells Create React App that you want a React component that renders an SVG, rather than its filename.
6363

6464
> **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 accessible title to your svg component.

‎docusaurus/docs/adding-relay.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: adding-relay
33
title: Adding Relay
44
---
55

6-
Relay is a framework for building data-driven React applications powered by GraphQL. The current release of Relay works with Create React App projects out of the box using Babel Macros. Simply set up your project as laid out in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
6+
Relay is a framework for building data-driven React applications powered by GraphQL. The current release of Relay works with Create React App projects out of the box using Babel Macros. Set up your project as shown in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
77

88
To add it, run:
99

‎docusaurus/docs/alternatives-to-ejecting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ id: alternatives-to-ejecting
33
title: Alternatives to Ejecting
44
---
55

6-
[Ejecting](available-scripts.md#npm-run-eject) lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting if you have many similar projects. In such cases instead of ejecting we recommend to _fork_ `react-scripts` and any other packages you need. [This article](https://auth0.com/blog/how-to-configure-create-react-app/) dives into how to do it in depth. You can find more discussion in [this issue](https://github.com/facebook/create-react-app/issues/682).
6+
[Ejecting](available-scripts.md#npm-run-eject) lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting if you have many similar projects. In such cases instead of ejecting we recommend to _fork_ `react-scripts` and any other packages you need. [This article](https://auth0.com/blog/how-to-configure-create-react-app/) covers how to do it in depth. You can find more discussion in [this issue](https://github.com/facebook/create-react-app/issues/682).

‎docusaurus/docs/can-i-use-decorators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Create React App intentionally doesn’t support decorator syntax at the moment
1010
- It is an experimental proposal and is subject to change (in fact, it has already changed once, and will change again).
1111
- Most libraries currently support only the old version of the proposal — which will never be a standard.
1212

13-
However in many cases you can rewrite decorator-based code without decorators just as fine.
13+
However in many cases you can rewrite decorator-based code without decorators and achieve the same result.
1414

1515
Please refer to these two threads for reference:
1616

‎docusaurus/docs/debugging-tests.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Open the following in Chrome
3232
about:inspect
3333
```
3434

35-
After opening that link, the Chrome Developer Tools will be displayed. Select `inspect` on your process and a breakpoint will be set at the first line of the react script (this is done simply to give you time to open the developer tools and to prevent Jest from executing before you have time to do so). Click the button that looks like a "play" button in the upper right hand side of the screen to continue execution. When Jest executes the test that contains the debugger statement, execution will pause and you can examine the current scope and call stack.
35+
After opening that link, the Chrome Developer Tools will be displayed. Select `inspect` on your process and a breakpoint will be set at the first line of the react script (this is done to give you time to open the developer tools and to prevent Jest from executing before you have time to do so). Click the button that looks like a "play" button in the upper right hand side of the screen to continue execution. When Jest executes the test that contains the debugger statement, execution will pause and you can examine the current scope and call stack.
3636

3737
> Note: the --runInBand cli option makes sure Jest runs test in the same process rather than spawning processes for individual tests. Normally Jest parallelizes test runs across processes but it is hard to debug many processes at the same time.
3838
@@ -51,12 +51,7 @@ Use the following [`launch.json`](https://code.visualstudio.com/docs/editor/debu
5151
"type": "node",
5252
"request": "launch",
5353
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
54-
"args": [
55-
"test",
56-
"--runInBand",
57-
"--no-cache",
58-
"--watchAll=false"
59-
],
54+
"args": ["test", "--runInBand", "--no-cache", "--watchAll=false"],
6055
"cwd": "${workspaceRoot}",
6156
"protocol": "inspector",
6257
"console": "integratedTerminal",

‎docusaurus/docs/deployment.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ serve -h
2929

3030
## Other Solutions
3131

32-
You don’t necessarily need a static server in order to run a Create React App project in production. It works just as fine integrated into an existing dynamic one.
32+
You don’t necessarily need a static server in order to run a Create React App project in production. It also works well when integrated into an existing server side app.
3333

3434
Here’s a programmatic example using [Node](https://nodejs.org/) and [Express](https://expressjs.com/):
3535

@@ -163,7 +163,7 @@ Variables in `.env.production` will be used as fallback because `NODE_ENV` will
163163

164164
## [AWS Amplify](http://console.amplify.aws)
165165

166-
The AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators) with serverless backends. The Amplify Console offers globally available CDNs, easy custom domain setup, feature branch deployments, and password protection.
166+
The AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators) with serverless backends. The Amplify Console offers globally available CDNs, custom domain setup, feature branch deployments, and password protection.
167167

168168
1. Login to the Amplify Console [here](https://console.aws.amazon.com/amplify/home).
169169
1. Connect your Create React App repo and pick a branch. If you're looking for a Create React App+Amplify starter, try the [create-react-app-auth-amplify starter](https://github.com/swaminator/create-react-app-auth-amplify) that demonstrates setting up auth in 10 minutes with Create React App.
@@ -189,7 +189,7 @@ Then run the `firebase init` command from your project’s root. You need to cho
189189

190190
First, let's associate this project directory with a Firebase project.
191191
You can create multiple project aliases by running firebase use --add,
192-
but for now we'll just set up a default project.
192+
but for now we'll set up a default project.
193193

194194
? What Firebase project do you want to associate as default? Example app (example-app-fd690)
195195

@@ -350,7 +350,7 @@ mywebsite.com
350350
GitHub Pages doesn’t support routers that use the HTML5 `pushState` history API under the hood (for example, React Router using `browserHistory`). This is because when there is a fresh page load for a url like `http://user.github.io/todomvc/todos/42`, where `/todos/42` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/todos/42`. If you want to add a router to a project hosted on GitHub Pages, here are a couple of solutions:
351351
352352
- You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router.
353-
- Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).
353+
- Alternatively, you can use a trick to teach GitHub Pages to handle 404s by redirecting to your `index.html` page with a custom redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).
354354
355355
### Troubleshooting
356356
@@ -472,7 +472,7 @@ Out of the box, you are preconfigured for client-side routing compatibility and
472472
473473
Render offers free [static site](https://render.com/docs/static-sites) hosting with fully managed SSL, a global CDN and continuous auto deploys from GitHub.
474474
475-
Deploy your app in just a few minutes by following the [Create React App deployment guide](https://render.com/docs/deploy-create-react-app).
475+
Deploy your app in only a few minutes by following the [Create React App deployment guide](https://render.com/docs/deploy-create-react-app).
476476
477477
Use invite code `cra` to sign up or use [this link](https://render.com/i/cra).
478478

‎docusaurus/docs/developing-components-in-isolation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ title: Developing Components in Isolation
44
---
55

66
Usually, in an app, you have a lot of UI components, and each of them has many different states.
7-
For an example, a simple button component could have the following states:
7+
For an example, a basic button component could have the following states:
88

99
- In a regular state, with a text label.
1010
- In the disabled mode.
1111
- In a loading state.
1212

1313
Usually, it’s hard to see these states without running a sample app or some examples.
1414

15-
Create React App doesn’t include any tools for this by default, but you can easily add [Storybook for React](https://storybook.js.org) ([source](https://github.com/storybooks/storybook)) or [React Styleguidist](https://react-styleguidist.js.org/) ([source](https://github.com/styleguidist/react-styleguidist)) to your project. **These are third-party tools that let you develop components and see all their states in isolation from your app**.
15+
Create React App doesn’t include any tools for this by default, but you can add [Storybook for React](https://storybook.js.org) ([source](https://github.com/storybooks/storybook)) or [React Styleguidist](https://react-styleguidist.js.org/) ([source](https://github.com/styleguidist/react-styleguidist)) to your project. **These are third-party tools that let you develop components and see all their states in isolation from your app**.
1616

1717
![Storybook for React Demo](https://i.imgur.com/7CIAWpB.gif)
1818

‎docusaurus/docs/fetching-data-with-ajax-requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Fetching Data
66

77
React doesn't prescribe a specific approach to data fetching, but people commonly use either a library like [axios](https://github.com/axios/axios) or the [`fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) provided by the browser.
88

9-
The global `fetch` function allows you to easily make AJAX requests. It takes in a URL as an input and returns a `Promise` that resolves to a `Response` object. You can find more information about `fetch` [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
9+
The global `fetch` function allows you to make AJAX requests. It takes in a URL as an input and returns a `Promise` that resolves to a `Response` object. You can find more information about `fetch` [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
1010

1111
A Promise represents the eventual result of an asynchronous operation, you can find more information about Promises [here](https://www.promisejs.org/) and [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Both axios and `fetch()` use Promises under the hood. You can also use the [`async / await`](https://davidwalsh.name/async-await) syntax to reduce the callback nesting.
1212

‎docusaurus/docs/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ When you’re ready to deploy to production, create a minified bundle with `npm
3030

3131
You **don’t** need to install or configure tools like Webpack or Babel. They are preconfigured and hidden so that you can focus on the code.
3232

33-
Just create a project, and you’re good to go.
33+
Create a project, and you’re good to go.
3434

3535
## Creating an App
3636

37-
**You’ll need to have Node >= 8.10 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.
37+
**You’ll need to have Node >= 8.10 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 switch Node versions between different projects.
3838

3939
To create a new app, you may choose one of the following methods:
4040

@@ -101,7 +101,7 @@ my-app
101101
└── serviceWorker.js
102102
```
103103

104-
No configuration or complicated folder structures, just the files you need to build your app. Once the installation is done, you can open your project folder:
104+
No configuration or complicated folder structures, only the files you need to build your app. Once the installation is done, you can open your project folder:
105105

106106
```sh
107107
cd my-app

‎docusaurus/docs/installing-a-dependency.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Alternatively you may use `yarn`:
1515
yarn add react-router-dom
1616
```
1717

18-
This works for any library, not just `react-router-dom`.
18+
This works for any library, not only `react-router-dom`.

‎docusaurus/docs/making-a-progressive-web-app.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ following into account:
6464
these messages is currently left as an exercise to the developer, but as a
6565
starting point, you can make use of the logic included in [`src/serviceWorker.js`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/src/serviceWorker.js), which
6666
demonstrates which service worker lifecycle events to listen for to detect each
67-
scenario, and which as a default, just logs appropriate messages to the
67+
scenario, and which as a default, only logs appropriate messages to the
6868
JavaScript console.
6969

7070
1. Service workers [require HTTPS](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers#you_need_https),
@@ -80,7 +80,7 @@ following into account:
8080
changes you've made locally.
8181

8282
1. If you _need_ to test your offline-first service worker locally, build
83-
the application (using `npm run build`) and run a simple http server from your
83+
the application (using `npm run build`) and run a standard http server from your
8484
build directory. After running the build script, `create-react-app` will give
8585
instructions for one way to test your production build locally and the [deployment instructions](deployment.md) have
8686
instructions for using other methods. _Be sure to always use an

‎docusaurus/docs/running-tests.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Jest will look for test files with any of the following popular naming conventio
2525

2626
The `.test.js` / `.spec.js` files (or the `__tests__` folders) can be located at any depth under the `src` top level folder.
2727

28-
We recommend to put the test files (or `__tests__` folders) next to the code they are testing so that relative imports appear shorter. For example, if `App.test.js` and `App.js` are in the same folder, the test just needs to `import App from './App'` instead of a long relative path. Collocation also helps find tests more quickly in larger projects.
28+
We recommend to put the test files (or `__tests__` folders) next to the code they are testing so that relative imports appear shorter. For example, if `App.test.js` and `App.js` are in the same folder, the test only needs to `import App from './App'` instead of a long relative path. Collocation also helps find tests more quickly in larger projects.
2929

3030
## Command Line Interface
3131

32-
When you run `npm test`, Jest will launch in watch mode<sup>\*</sup>. Every time you save a file, it will re-run the tests, just like `npm start` recompiles the code.
32+
When you run `npm test`, Jest will launch in watch mode<sup>\*</sup>. Every time you save a file, it will re-run the tests, like how `npm start` recompiles the code.
3333

3434
The watcher includes an interactive command-line interface with the ability to run all tests, or focus on a search pattern. It is designed this way so that you can keep it open and enjoy fast re-runs. You can learn the commands from the “Watch Usage” note that the watcher prints after every run:
3535

@@ -68,7 +68,7 @@ You can also use [`jest.fn()` and `expect(fn).toBeCalled()`](https://jestjs.io/d
6868

6969
There is a broad spectrum of component testing techniques. They range from a “smoke test” verifying that a component renders without throwing, to shallow rendering and testing some of the output, to full rendering and testing component lifecycle and state changes.
7070

71-
Different projects choose different testing tradeoffs based on how often components change, and how much logic they contain. If you haven’t decided on a testing strategy yet, we recommend that you start with creating simple smoke tests for your components:
71+
Different projects choose different testing tradeoffs based on how often components change, and how much logic they contain. If you haven’t decided on a testing strategy yet, we recommend that you start with creating basic smoke tests for your components:
7272

7373
```js
7474
import React from 'react';
@@ -149,7 +149,7 @@ All Jest matchers are [extensively documented here](https://jestjs.io/docs/en/ex
149149

150150
Nevertheless you can use a third-party assertion library like [Chai](https://chaijs.com/) if you want to, as described below.
151151

152-
Additionally, you might find [jest-enzyme](https://github.com/blainekasten/enzyme-matchers) helpful to simplify your tests with readable matchers. The above `contains` code can be written more simply with jest-enzyme.
152+
Additionally, you might find [jest-enzyme](https://github.com/blainekasten/enzyme-matchers) helpful to improve your tests with readable matchers. The above `contains` code can be written more concisely with jest-enzyme.
153153

154154
```js
155155
expect(wrapper).toContainReact(welcome);
@@ -229,7 +229,7 @@ and then use them in your tests like you normally do.
229229

230230
> Note: this feature is available with `react-scripts@0.4.0` and higher.
231231
232-
If your app uses a browser API that you need to mock in your tests or if you just need a global setup before running your tests, add a `src/setupTests.js` to your project. It will be automatically executed before running your tests.
232+
If your app uses a browser API that you need to mock in your tests or if you need a global setup before running your tests, add a `src/setupTests.js` to your project. It will be automatically executed before running your tests.
233233

234234
For example:
235235

@@ -387,7 +387,7 @@ CI=true npm run build
387387

388388
The test command will force Jest to run in CI-mode, and tests will only run once instead of launching the watcher.
389389

390-
For non-CI environments, you can simply pass the `--watchAll=false` flag to disable test-watching.
390+
For non-CI environments, you can pass the `--watchAll=false` flag to disable test-watching.
391391

392392
The build command will check for linter warnings and fail if any are found.
393393

‎docusaurus/docs/setting-up-your-editor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Alternatively you may use `yarn`:
142142
yarn add husky lint-staged prettier
143143
```
144144

145-
- `husky` makes it easy to use githooks as if they are npm scripts.
145+
- `husky` makes it possible to use githooks as if they are npm scripts.
146146
- `lint-staged` allows us to run scripts on staged files in git. See this [blog post about lint-staged to learn more about it](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8).
147147
- `prettier` is the JavaScript formatter we will run before commits.
148148

‎docusaurus/docs/supported-browsers-features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Here is an example `browserslist` that is specified in `package.json`:
5252

5353
> Note that this does not include polyfills automatically for you. You will still need to polyfill language features (see above) as needed based on the browsers your are supporting.
5454
55-
> When editing the `browserslist` config, you may notice that your changes don't get picked up right away. This is due to an [issue in babel-loader](https://github.com/babel/babel-loader/issues/690) not detecting the change in your `package.json`. An easy solution is to delete the `node_modules/.cache` folder and try again.
55+
> When editing the `browserslist` config, you may notice that your changes don't get picked up right away. This is due to an [issue in babel-loader](https://github.com/babel/babel-loader/issues/690) not detecting the change in your `package.json`. An quick solution is to delete the `node_modules/.cache` folder and try again.

‎docusaurus/docs/title-and-meta-tags.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ If you use a custom server for your app in production and want to modify the tit
1919
Since Create React App doesn’t support server rendering, you might be wondering how to make `<meta>` tags dynamic and reflect the current URL. To solve this, we recommend to add placeholders into the HTML, like this:
2020

2121
```html
22-
<!doctype html>
22+
<!DOCTYPE html>
2323
<html lang="en">
2424
<head>
25-
<meta property="og:title" content="__OG_TITLE__">
26-
<meta property="og:description" content="__OG_DESCRIPTION__">
25+
<meta property="og:title" content="__OG_TITLE__" />
26+
<meta property="og:description" content="__OG_DESCRIPTION__" />
27+
</head>
28+
</html>
2729
```
2830

29-
Then, on the server, regardless of the backend you use, you can read `index.html` into memory and replace `__OG_TITLE__`, `__OG_DESCRIPTION__`, and any other placeholders with values depending on the current URL. Just make sure to sanitize and escape the interpolated values so that they are safe to embed into HTML!
31+
Then, on the server, regardless of the backend you use, you can read `index.html` into memory and replace `__OG_TITLE__`, `__OG_DESCRIPTION__`, and any other placeholders with values depending on the current URL. Make sure to sanitize and escape the interpolated values so that they are safe to embed into HTML!
3032

31-
If you use a Node server, you can even share the route matching logic between the client and the server. However duplicating it also works fine in simple cases.
33+
If you use a Node server, you can even share the route matching logic between the client and the server. However duplicating it also works fine in basic cases.
3234

3335
## Injecting Data from the Server into the Page
3436

‎docusaurus/docs/using-global-variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ You can avoid this by reading the global variable explicitly from the `window` o
1111
const $ = window.$;
1212
```
1313

14-
This makes it obvious you are using a global variable intentionally rather than because of a typo.
14+
This makes it clear you are using a global variable intentionally rather than because of a typo.
1515

1616
Alternatively, you can force the linter to ignore any line by adding `// eslint-disable-line` after it.

‎docusaurus/docs/using-the-public-folder.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ This mechanism provides a number of benefits:
2424

2525
However there is an **escape hatch** that you can use to add an asset outside of the module system.
2626

27-
If you put a file into the `public` folder, it will **not** be processed by Webpack. Instead it will be copied into the build folder untouched. To reference assets in the `public` folder, you need to use a special variable called `PUBLIC_URL`.
27+
If you put a file into the `public` folder, it will **not** be processed by Webpack. Instead it will be copied into the build folder untouched. To reference assets in the `public` folder, you need to use an environment variable called `PUBLIC_URL`.
2828

2929
Inside `index.html`, you can use it like this:
3030

3131
```html
32-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico">
32+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
3333
```
3434

3535
Only files inside the `public` folder will be accessible by `%PUBLIC_URL%` prefix. If you need to use a file from `src` or `node_modules`, you’ll have to copy it there to explicitly specify your intention to make this file a part of the build.

‎package.json

+3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
"start": "cd packages/react-scripts && node bin/react-scripts.js start",
1515
"screencast": "node ./tasks/screencast.js",
1616
"screencast:error": "svg-term --cast jyu19xGl88FQ3poMY8Hbmfw8y --out screencast-error.svg --window --at 12000 --no-cursor",
17+
"alex": "alex .",
1718
"test": "cd packages/react-scripts && node bin/react-scripts.js test",
1819
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'",
1920
"compile:lockfile": "node tasks/compile-lockfile.js"
2021
},
2122
"devDependencies": {
23+
"alex": "^8.0.0",
2224
"eslint": "^6.1.0",
2325
"execa": "1.0.0",
2426
"fs-extra": "^7.0.1",
@@ -45,6 +47,7 @@
4547
},
4648
"lint-staged": {
4749
"*.{js,md,css,html}": [
50+
"alex",
4851
"prettier --trailing-comma es5 --single-quote --write",
4952
"git add"
5053
],

‎packages/react-scripts/fixtures/kitchensink/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This is an end to end kitchensink test suite, but has multiple usages in it.
44

55
## Running the test suite
66

7-
Tests are automatically run by the CI tools.
7+
Tests are automatically run by the CI tools.
88
In order to run them locally, without having to manually install and configure everything, the `yarn e2e:docker` CLI command can be used.
99

10-
This is a simple script that runs a **Docker** container, where the node version, git branch to clone, test suite, and whether to run it with `yarn` or `npm` can be chosen.
11-
Simply run `yarn e2e:docker --help` to get additional info.
10+
This is a script that runs a **Docker** container, where the node version, git branch to clone, test suite, and whether to run it with `yarn` or `npm` can be chosen.
11+
Run `yarn e2e:docker --help` to get additional info.
1212

1313
If you need guidance installing **Docker**, you should follow their [official docs](https://docs.docker.com/engine/installation/).
1414

@@ -28,20 +28,20 @@ Features are categorized by their scope:
2828

2929
In it's most basic for this serve as a collection of unit tests on a single functionality.
3030

31-
Unit tests are written in a `src/features/**/*.test.js` file located in the same folder as the feature they test, and usually consist of a simple `ReactDOM.render` call.
31+
Unit tests are written in a `src/features/**/*.test.js` file located in the same folder as the feature they test, and usually consist of a `ReactDOM.render` call.
3232

3333
These tests are run by **jest** and the environment is `test`, so that it resembles how a **Create React App** application is tested.
3434

3535
### Using it as Integration Tests
3636

37-
This suite tests how the single features as before behave while development and in production.
37+
This suite tests how the single features as before behave while development and in production.
3838
A local HTTP server is started, then every single feature is loaded, one by one, to be tested.
3939

4040
Test are written in `integration/{env|syntax|webpack}.test.js`, depending on their scope.
4141

42-
For every test case added there is just a little chore to do:
42+
For every test case added there is only a little chore to do:
4343

44-
- a `case` statement must be added in `src/App.js`, which simply perform a dynamic `import()` of the feature
44+
- a `case` statement must be added in `src/App.js`, which performs a dynamic `import()` of the feature
4545

4646
- add a test case in the appropriate integration test file, which calls and awaits `initDOM` with the previous `SwitchCase` string
4747

0 commit comments

Comments
 (0)
Please sign in to comment.