Skip to content

Commit e0e3e0f

Browse files
Add no-trailing-spaces ESLint rule
1 parent 40ea071 commit e0e3e0f

File tree

84 files changed

+595
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+595
-594
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"react-hooks/exhaustive-deps": "error",
1010
"react/no-unknown-property": ["error", {"ignore": ["meta"]}],
1111
"react-compiler/react-compiler": "error",
12-
"local-rules/lint-markdown-code-blocks": "error"
12+
"local-rules/lint-markdown-code-blocks": "error",
13+
"no-trailing-spaces": "error"
1314
},
1415
"env": {
1516
"node": true,

src/content/blog/2023/03/16/introducing-react-dev.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,17 @@ export default function PackingList() {
279279
<section>
280280
<h1>Sally Ride's Packing List</h1>
281281
<ul>
282-
<Item
283-
isPacked={true}
284-
name="Space suit"
282+
<Item
283+
isPacked={true}
284+
name="Space suit"
285285
/>
286-
<Item
287-
isPacked={true}
288-
name="Helmet with a golden leaf"
286+
<Item
287+
isPacked={true}
288+
name="Helmet with a golden leaf"
289289
/>
290-
<Item
291-
isPacked={false}
292-
name="Photo of Tam"
290+
<Item
291+
isPacked={false}
292+
name="Photo of Tam"
293293
/>
294294
</ul>
295295
</section>
@@ -317,17 +317,17 @@ export default function PackingList() {
317317
<section>
318318
<h1>Sally Ride's Packing List</h1>
319319
<ul>
320-
<Item
321-
isPacked={true}
322-
name="Space suit"
320+
<Item
321+
isPacked={true}
322+
name="Space suit"
323323
/>
324-
<Item
325-
isPacked={true}
326-
name="Helmet with a golden leaf"
324+
<Item
325+
isPacked={true}
326+
name="Helmet with a golden leaf"
327327
/>
328-
<Item
329-
isPacked={false}
330-
name="Photo of Tam"
328+
<Item
329+
isPacked={false}
330+
name="Photo of Tam"
331331
/>
332332
</ul>
333333
</section>
@@ -365,17 +365,17 @@ export default function PackingList() {
365365
<section>
366366
<h1>Sally Ride's Packing List</h1>
367367
<ul>
368-
<Item
369-
importance={9}
370-
name="Space suit"
368+
<Item
369+
importance={9}
370+
name="Space suit"
371371
/>
372-
<Item
373-
importance={0}
374-
name="Helmet with a golden leaf"
372+
<Item
373+
importance={0}
374+
name="Helmet with a golden leaf"
375375
/>
376-
<Item
377-
importance={6}
378-
name="Photo of Tam"
376+
<Item
377+
importance={6}
378+
name="Photo of Tam"
379379
/>
380380
</ul>
381381
</section>
@@ -409,17 +409,17 @@ export default function PackingList() {
409409
<section>
410410
<h1>Sally Ride's Packing List</h1>
411411
<ul>
412-
<Item
413-
importance={9}
414-
name="Space suit"
412+
<Item
413+
importance={9}
414+
name="Space suit"
415415
/>
416-
<Item
417-
importance={0}
418-
name="Helmet with a golden leaf"
416+
<Item
417+
importance={0}
418+
name="Helmet with a golden leaf"
419419
/>
420-
<Item
421-
importance={6}
422-
name="Photo of Tam"
420+
<Item
421+
importance={6}
422+
name="Photo of Tam"
423423
/>
424424
</ul>
425425
</section>

src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ We refer to this broader collection of features as simply "Actions". Actions all
4949

5050
The `action` function can operate synchronously or asynchronously. You can define them on the client side using standard JavaScript or on the server with the [`'use server'`](/reference/rsc/use-server) directive. When using an action, React will manage the life cycle of the data submission for you, providing hooks like [`useFormStatus`](/reference/react-dom/hooks/useFormStatus), and [`useActionState`](/reference/react/useActionState) to access the current state and response of the form action.
5151

52-
By default, Actions are submitted within a [transition](/reference/react/useTransition), keeping the current page interactive while the action is processing. Since Actions support async functions, we've also added the ability to use `async/await` in transitions. This allows you to show pending UI with the `isPending` state of a transition when an async request like `fetch` starts, and show the pending UI all the way through the update being applied.
52+
By default, Actions are submitted within a [transition](/reference/react/useTransition), keeping the current page interactive while the action is processing. Since Actions support async functions, we've also added the ability to use `async/await` in transitions. This allows you to show pending UI with the `isPending` state of a transition when an async request like `fetch` starts, and show the pending UI all the way through the update being applied.
5353

5454
Alongside Actions, we're introducing a feature named [`useOptimistic`](/reference/react/useOptimistic) for managing optimistic state updates. With this hook, you can apply temporary updates that are automatically reverted once the final state commits. For Actions, this allows you to optimistically set the final state of the data on the client, assuming the submission is successful, and revert to the value for data received from the server. It works using regular `async`/`await`, so it works the same whether you're using `fetch` on the client, or a Server Action from the server.
5555

5656
Library authors can implement custom `action={fn}` props in their own components with `useTransition`. Our intent is for libraries to adopt the Actions pattern when designing their component APIs, to provide a consistent experience for React developers. For example, if your library provides a `<Calendar onSelect={eventHandler}>` component, consider also exposing a `<Calendar selectAction={action}>` API, too.
5757

58-
While we initially focused on Server Actions for client-server data transfer, our philosophy for React is to provide the same programming model across all platforms and environments. When possible, if we introduce a feature on the client, we aim to make it also work on the server, and vice versa. This philosophy allows us to create a single set of APIs that work no matter where your app runs, making it easier to upgrade to different environments later.
58+
While we initially focused on Server Actions for client-server data transfer, our philosophy for React is to provide the same programming model across all platforms and environments. When possible, if we introduce a feature on the client, we aim to make it also work on the server, and vice versa. This philosophy allows us to create a single set of APIs that work no matter where your app runs, making it easier to upgrade to different environments later.
5959

6060
Actions are now available in the Canary channel and will ship in the next release of React.
6161

6262
## New Features in React Canary {/*new-features-in-react-canary*/}
6363

64-
We introduced [React Canaries](/blog/2023/05/03/react-canaries) as an option to adopt individual new stable features as soon as their design is close to final, before they’re released in a stable semver version.
64+
We introduced [React Canaries](/blog/2023/05/03/react-canaries) as an option to adopt individual new stable features as soon as their design is close to final, before they’re released in a stable semver version.
6565

6666
Canaries are a change to the way we develop React. Previously, features would be researched and built privately inside of Meta, so users would only see the final polished product when released to Stable. With Canaries, we’re building in public with the help of the community to finalize features we share in the React Labs blog series. This means you hear about new features sooner, as they’re being finalized instead of after they’re complete.
6767

@@ -75,7 +75,7 @@ React Server Components, Asset Loading, Document Metadata, and Actions have all
7575

7676
- **Actions**: As shared above, we've added Actions to manage sending data from the client to the server. You can add `action` to elements like [`<form/>`](/reference/react-dom/components/form), access the status with [`useFormStatus`](/reference/react-dom/hooks/useFormStatus), handle the result with [`useActionState`](/reference/react/useActionState), and optimistically update the UI with [`useOptimistic`](/reference/react/useOptimistic).
7777

78-
Since all of these features work together, it’s difficult to release them in the Stable channel individually. Releasing Actions without the complementary hooks for accessing form states would limit the practical usability of Actions. Introducing React Server Components without integrating Server Actions would complicate modifying data on the server.
78+
Since all of these features work together, it’s difficult to release them in the Stable channel individually. Releasing Actions without the complementary hooks for accessing form states would limit the practical usability of Actions. Introducing React Server Components without integrating Server Actions would complicate modifying data on the server.
7979

8080
Before we can release a set of features to the Stable channel, we need to ensure they work cohesively and developers have everything they need to use them in production. React Canaries allow us to develop these features individually, and release the stable APIs incrementally until the entire feature set is complete.
8181

src/content/blog/2024/04/25/react-19-upgrade-guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The improvements added to React 19 require some breaking changes, but we've work
2020

2121
#### React 18.3 has also been published {/*react-18-3*/}
2222

23-
To help make the upgrade to React 19 easier, we've published a `react@18.3` release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19.
23+
To help make the upgrade to React 19 easier, we've published a `react@18.3` release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19.
2424

2525
We recommend upgrading to React 18.3 first to help identify any issues before upgrading to React 19.
2626

@@ -109,25 +109,25 @@ npx codemod@latest react/19/migration-recipe
109109
```
110110

111111
This will run the following codemods from `react-codemod`:
112-
- [`replace-reactdom-render`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-reactdom-render)
112+
- [`replace-reactdom-render`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-reactdom-render)
113113
- [`replace-string-ref`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-string-ref)
114114
- [`replace-act-import`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-act-import)
115-
- [`replace-use-form-state`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-use-form-state)
115+
- [`replace-use-form-state`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-use-form-state)
116116
- [`prop-types-typescript`](https://github.com/reactjs/react-codemod#react-proptypes-to-prop-types)
117117

118118
This does not include the TypeScript changes. See [TypeScript changes](#typescript-changes) below.
119119

120120
</Note>
121121

122-
Changes that include a codemod include the command below.
122+
Changes that include a codemod include the command below.
123123

124124
For a list of all available codemods, see the [`react-codemod` repo](https://github.com/reactjs/react-codemod).
125125

126126
## Breaking changes {/*breaking-changes*/}
127127

128128
### Errors in render are not re-thrown {/*errors-in-render-are-not-re-thrown*/}
129129

130-
In previous versions of React, errors thrown during render were caught and rethrown. In DEV, we would also log to `console.error`, resulting in duplicate error logs.
130+
In previous versions of React, errors thrown during render were caught and rethrown. In DEV, we would also log to `console.error`, resulting in duplicate error logs.
131131

132132
In React 19, we've [improved how errors are handled](/blog/2024/04/25/react-19#error-handling) to reduce duplication by not re-throwing:
133133

@@ -348,7 +348,7 @@ npm install react-shallow-renderer --save-dev
348348

349349
##### Please reconsider shallow rendering {/*please-reconsider-shallow-rendering*/}
350350

351-
Shallow rendering depends on React internals and can block you from future upgrades. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro).
351+
Shallow rendering depends on React internals and can block you from future upgrades. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro).
352352

353353
</Note>
354354

@@ -465,7 +465,7 @@ npx codemod@latest react/19/replace-reactdom-render
465465

466466
#### Removed: `ReactDOM.findDOMNode` {/*removed-reactdom-finddomnode*/}
467467

468-
`ReactDOM.findDOMNode` was [deprecated in October 2018 (v16.6.0)](https://legacy.reactjs.org/blog/2018/10/23/react-v-16-6.html#deprecations-in-strictmode).
468+
`ReactDOM.findDOMNode` was [deprecated in October 2018 (v16.6.0)](https://legacy.reactjs.org/blog/2018/10/23/react-v-16-6.html#deprecations-in-strictmode).
469469

470470
We're removing `findDOMNode` because it was a legacy escape hatch that was slow to execute, fragile to refactoring, only returned the first child, and broke abstraction levels (see more [here](https://legacy.reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage)). You can replace `ReactDOM.findDOMNode` with [DOM refs](/learn/manipulating-the-dom-with-refs):
471471

@@ -551,7 +551,7 @@ This change means Suspense fallbacks display faster, while still warming lazy re
551551

552552
### UMD builds removed {/*umd-builds-removed*/}
553553

554-
UMD was widely used in the past as a convenient way to load React without a build step. Now, there are modern alternatives for loading modules as scripts in HTML documents. Starting with React 19, React will no longer produce UMD builds to reduce the complexity of its testing and release process.
554+
UMD was widely used in the past as a convenient way to load React without a build step. Now, there are modern alternatives for loading modules as scripts in HTML documents. Starting with React 19, React will no longer produce UMD builds to reduce the complexity of its testing and release process.
555555

556556
To load React 19 with a script tag, we recommend using an ESM-based CDN such as [esm.sh](https://esm.sh/).
557557

@@ -569,7 +569,7 @@ This release includes changes to React internals that may impact libraries that
569569

570570
Based on our [Versioning Policy](https://react.dev/community/versioning-policy#what-counts-as-a-breaking-change), these updates are not listed as breaking changes, and we are not including docs for how to upgrade them. The recommendation is to remove any code that depends on internals.
571571

572-
To reflect the impact of using internals, we have renamed the `SECRET_INTERNALS` suffix to:
572+
To reflect the impact of using internals, we have renamed the `SECRET_INTERNALS` suffix to:
573573

574574
`_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`
575575

0 commit comments

Comments
 (0)