Skip to content

Commit c2dbfd1

Browse files
authored
Merge branch 'main' into no-use-in-try-catch
2 parents 246155b + 5fd2015 commit c2dbfd1

File tree

22 files changed

+159
-24
lines changed

22 files changed

+159
-24
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.27.1-beta.4
1+
1.27.1-next.5

apps/website/content/docs/rules/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"dom-no-dangerously-set-innerhtml",
5959
"dom-no-dangerously-set-innerhtml-with-children",
6060
"dom-no-find-dom-node",
61+
"dom-no-flush-sync",
6162
"dom-no-missing-button-type",
6263
"dom-no-missing-iframe-sandbox",
6364
"dom-no-namespace",

apps/website/content/docs/rules/overview.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ full: true
7979
| [`no-dangerously-set-innerhtml-with-children`](./dom-no-dangerously-set-innerhtml-with-children) | 2️⃣ | `🔍` | Prevents DOM elements using `dangerouslySetInnerHTML` and `children` at the same time. |
8080
| [`no-dangerously-set-innerhtml`](./dom-no-dangerously-set-innerhtml) | 1️⃣ | `🔍` | Prevents DOM elements using `dangerouslySetInnerHTML`. |
8181
| [`no-find-dom-node`](./dom-no-find-dom-node) | 2️⃣ | `🔍` | Prevents using `findDOMNode`. |
82+
| [`no-flush-sync`](./dom-no-flush-sync) | 1️⃣ | `🔍` | Prevents using `flushSync`. |
8283
| [`no-missing-button-type`](./dom-no-missing-button-type) | 1️⃣ | `🔍` | Enforces explicit `type` attribute for `button` elements. |
8384
| [`no-missing-iframe-sandbox`](./dom-no-missing-iframe-sandbox) | 1️⃣ | `🔍` | Enforces explicit `sandbox` attribute for `iframe` elements. |
8485
| [`no-namespace`](./dom-no-namespace) | 2️⃣ | `🔍` | Enforces the absence of a `namespace` in React elements. |
@@ -131,11 +132,11 @@ full: true
131132

132133
| Rule | Replaced by | Deprecated in |
133134
| :--------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :------------ |
134-
| [`jsx-uses-vars`](jsx-uses-vars) | [`use-jsx-vars`](./use-jsx-vars) | v1.22.0 |
135-
| [`jsx-no-duplicate-props`](jsx-no-duplicate-props) | [`no-duplicate-jsx-props`](./no-duplicate-jsx-props) | v1.22.0 |
136-
| [`no-complicated-conditional-rendering`](no-complicated-conditional-rendering) | [`no-complex-conditional-rendering`](./no-complex-conditional-rendering) | v1.6.0 |
137-
| [`dom/no-children-in-void-dom-elements`](dom-no-children-in-void-dom-elements) | [`dom/no-void-elements-with-children`](./dom-no-void-elements-with-children) | v1.22.0 |
138-
| [`hooks-extra/no-redundant-custom-hook`](hooks-extra-no-useless-custom-hooks) | [`hooks-extra/no-useless-custom-hooks`](./hooks-extra-no-useless-custom-hooks) | v1.21.0 |
139-
| [`hooks-extra/ensure-custom-hooks-using-other-hooks`](hooks-extra-no-useless-custom-hooks) | [`hooks-extra/no-useless-custom-hooks`](./hooks-extra-no-useless-custom-hooks) | v1.13.0 |
140-
| [`hooks-extra/ensure-use-memo-has-non-empty-deps`](hooks-extra-ensure-use-memo-has-non-empty-deps) | [`hooks-extra/no-unnecessary-use-memo`](./hooks-extra-no-unnecessary-use-memo) | v1.13.0 |
141-
| [`hooks-extra/ensure-use-callback-has-non-empty-deps`](hooks-extra-ensure-use-callback-has-non-empty-deps) | [`hooks-extra/no-unnecessary-use-callback`](./hooks-extra-no-unnecessary-use-callback) | v1.13.0 |
135+
| [`jsx-uses-vars`](jsx-uses-vars) | [`use-jsx-vars`](./use-jsx-vars) | 1.22.0 |
136+
| [`jsx-no-duplicate-props`](jsx-no-duplicate-props) | [`no-duplicate-jsx-props`](./no-duplicate-jsx-props) | 1.22.0 |
137+
| [`no-complicated-conditional-rendering`](no-complicated-conditional-rendering) | [`no-complex-conditional-rendering`](./no-complex-conditional-rendering) | 1.6.0 |
138+
| [`dom/no-children-in-void-dom-elements`](dom-no-children-in-void-dom-elements) | [`dom/no-void-elements-with-children`](./dom-no-void-elements-with-children) | 1.22.0 |
139+
| [`hooks-extra/no-redundant-custom-hook`](hooks-extra-no-useless-custom-hooks) | [`hooks-extra/no-useless-custom-hooks`](./hooks-extra-no-useless-custom-hooks) | 1.21.0 |
140+
| [`hooks-extra/ensure-custom-hooks-using-other-hooks`](hooks-extra-no-useless-custom-hooks) | [`hooks-extra/no-useless-custom-hooks`](./hooks-extra-no-useless-custom-hooks) | 1.13.0 |
141+
| [`hooks-extra/ensure-use-memo-has-non-empty-deps`](hooks-extra-ensure-use-memo-has-non-empty-deps) | [`hooks-extra/no-unnecessary-use-memo`](./hooks-extra-no-unnecessary-use-memo) | 1.13.0 |
142+
| [`hooks-extra/ensure-use-callback-has-non-empty-deps`](hooks-extra-ensure-use-callback-has-non-empty-deps) | [`hooks-extra/no-unnecessary-use-callback`](./hooks-extra-no-unnecessary-use-callback) | 1.13.0 |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/monorepo",
3-
"version": "1.27.1-beta.4",
3+
"version": "1.27.1-next.5",
44
"private": true,
55
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
66
"keywords": [

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/core",
3-
"version": "1.27.1-beta.4",
3+
"version": "1.27.1-next.5",
44
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/plugins/eslint-plugin-react-debug/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-debug",
3-
"version": "1.27.1-beta.4",
3+
"version": "1.27.1-next.5",
44
"description": "ESLint React's ESLint plugin for debugging related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-dom",
3-
"version": "1.27.1-beta.4",
3+
"version": "1.27.1-next.5",
44
"description": "ESLint React's ESLint plugin for React DOM related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-dom/src/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { name, version } from "../package.json";
22
import noDangerouslySetInnerHTML from "./rules/no-dangerously-set-innerhtml";
33
import noDangerouslySetInnerHTMLWithChildren from "./rules/no-dangerously-set-innerhtml-with-children";
44
import noFindDomNode from "./rules/no-find-dom-node";
5+
import noFlushSync from "./rules/no-flush-sync";
56
import noMissingButtonType from "./rules/no-missing-button-type";
67
import noMissingIframeSandbox from "./rules/no-missing-iframe-sandbox";
78
import noNamespace from "./rules/no-namespace";
@@ -21,6 +22,7 @@ export const plugin = {
2122
"no-dangerously-set-innerhtml": noDangerouslySetInnerHTML,
2223
"no-dangerously-set-innerhtml-with-children": noDangerouslySetInnerHTMLWithChildren,
2324
"no-find-dom-node": noFindDomNode,
25+
"no-flush-sync": noFlushSync,
2426
"no-missing-button-type": noMissingButtonType,
2527
"no-missing-iframe-sandbox": noMissingIframeSandbox,
2628
"no-namespace": noNamespace,

packages/plugins/eslint-plugin-react-dom/src/rules/no-find-dom-node.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ class AutoSelectingInput extends Component {
8080

8181
## Further Reading
8282

83-
- [React: APIs findDOMNode](https://react.dev/reference/react-dom/findDOMNode)
83+
- [React DOM: APIs findDOMNode](https://react.dev/reference/react-dom/findDOMNode)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: no-flush-sync
3+
---
4+
5+
**Full Name in `eslint-plugin-react-dom`**
6+
7+
```plain copy
8+
react-dom/no-flush-sync
9+
```
10+
11+
**Full Name in `@eslint-react/eslint-plugin`**
12+
13+
```plain copy
14+
@eslint-react/dom/no-flush-sync
15+
```
16+
17+
**Features**
18+
19+
`🔍`
20+
21+
## What it does
22+
23+
This rule reports usages of `flushSync`.
24+
25+
`flushSync` can significantly hurt performance, and may unexpectedly force pending Suspense boundaries to show their fallback state.
26+
27+
Most of the time, `flushSync` can be avoided, so use `flushSync` as a last resort.
28+
29+
## Examples
30+
31+
### Failing
32+
33+
```tsx
34+
import { flushSync } from "react-dom";
35+
36+
flushSync(() => {
37+
setSomething(123);
38+
});
39+
```
40+
41+
## Implementation
42+
43+
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-flush-sync.ts)
44+
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-flush-sync.spec.ts)
45+
46+
## Further Reading
47+
48+
- [React DOM: APIs flushSync](https://react.dev/reference/react-dom/flushSync)

0 commit comments

Comments
 (0)