Skip to content

Commit ae115e6

Browse files
authored
fix: update rule severity for 'no-flush-sync' and 'no-void-elements-with-children' (#988)
1 parent c151c78 commit ae115e6

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ full: true
2020
| :----------------------------------------------------------------------------------- | :- | :------------ | :---------------------------------------------------------------------------------------------------- | :------: |
2121
| [`avoid-shorthand-boolean`](./avoid-shorthand-boolean) | 0️⃣ | `🔍` `🔧` | Enforces the use of explicit boolean values for boolean attributes. | |
2222
| [`avoid-shorthand-fragment`](./avoid-shorthand-fragment) | 0️⃣ | `🔍` | Enforces the use of explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax. | |
23-
| [`no-useless-forward-ref`](./no-useless-forward-ref) | 1️⃣ | `🔍` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | |
2423
| [`no-access-state-in-setstate`](./no-access-state-in-setstate) | 2️⃣ | `🔍` | Prevents accessing `this.state` inside `setState` calls. | |
2524
| [`no-array-index-key`](./no-array-index-key) | 1️⃣ | `🔍` | Prevents using an item's index in the array as its key | |
2625
| [`no-children-count`](./no-children-count) | 1️⃣ | `🔍` | Prevents using `Children.count`. | |
@@ -63,6 +62,7 @@ full: true
6362
| [`no-unused-class-component-members`](./no-unused-class-component-members) | 1️⃣ | `🔍` | Warns unused class component methods and properties. | |
6463
| [`no-unused-state`](./no-unused-state) | 1️⃣ | `🔍` | Warns unused class component state. | |
6564
| [`no-use-context`](./no-use-context) | 1️⃣ | `🔍` `🔄` | Replaces usages of `useContext` with `use`. | >=19.0.0 |
65+
| [`no-useless-forward-ref`](./no-useless-forward-ref) | 1️⃣ | `🔍` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | |
6666
| [`no-useless-fragment`](./no-useless-fragment) | 1️⃣ | `🔍` `🔧` `⚙️` | Prevents using useless `fragment` components or `<>` syntax. | |
6767
| [`prefer-destructuring-assignment`](./prefer-destructuring-assignment) | 0️⃣ | `🔍` | Enforces using destructuring assignment over property assignment. | |
6868
| [`prefer-react-namespace-import`](./prefer-react-namespace-import) | 0️⃣ | `🔍` `🔧` | Enforces React is imported via a namespace import | |
@@ -75,19 +75,19 @@ full: true
7575

7676
| Rule || Features | Description |
7777
| :----------------------------------------------------------------------------------------------- | :- | :------------ | :------------------------------------------------------------------------------------- |
78-
| [`no-void-elements-with-children`](./dom-no-void-elements-with-children) | 2️⃣ | `🔍` | Prevents using `children` in void DOM elements. |
79-
| [`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. |
8078
| [`no-dangerously-set-innerhtml`](./dom-no-dangerously-set-innerhtml) | 1️⃣ | `🔍` | Prevents DOM elements using `dangerouslySetInnerHTML`. |
79+
| [`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. |
8180
| [`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`. |
81+
| [`no-flush-sync`](./dom-no-flush-sync) | 2️⃣ | `🔍` | Prevents using `flushSync`. |
8382
| [`no-missing-button-type`](./dom-no-missing-button-type) | 1️⃣ | `🔍` | Enforces explicit `type` attribute for `button` elements. |
8483
| [`no-missing-iframe-sandbox`](./dom-no-missing-iframe-sandbox) | 1️⃣ | `🔍` | Enforces explicit `sandbox` attribute for `iframe` elements. |
8584
| [`no-namespace`](./dom-no-namespace) | 2️⃣ | `🔍` | Enforces the absence of a `namespace` in React elements. |
8685
| [`no-render-return-value`](./dom-no-render-return-value) | 2️⃣ | `🔍` | Prevents using the return value of `ReactDOM.render`. |
8786
| [`no-script-url`](./dom-no-script-url) | 1️⃣ | `🔍` | Prevents using `javascript:` URLs as the value of attributes. |
88-
| [`no-unknown-property`](./dom-no-unknown-property) | 0️⃣ | `🔍` `🔧` `⚙️` | Prevents using unknown `DOM` property |
87+
| [`no-unknown-property`](./dom-no-unknown-property) | 1️⃣ | `🔍` `🔧` `⚙️` | Prevents using unknown `DOM` property |
8988
| [`no-unsafe-iframe-sandbox`](./dom-no-unsafe-iframe-sandbox) | 1️⃣ | `🔍` | Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations. |
9089
| [`no-unsafe-target-blank`](./dom-no-unsafe-target-blank) | 1️⃣ | `🔍` | Prevents using `target="_blank"` without `rel="noreferrer noopener"`. |
90+
| [`no-void-elements-with-children`](./dom-no-void-elements-with-children) | 2️⃣ | `🔍` | Prevents using `children` in void DOM elements. |
9191

9292
## Web API Rules
9393

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const rules = {
77
"react-dom/no-dangerously-set-innerhtml": "warn",
88
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
99
"react-dom/no-find-dom-node": "error",
10+
"react-dom/no-flush-sync": "error",
1011
"react-dom/no-missing-button-type": "warn",
1112
"react-dom/no-missing-iframe-sandbox": "warn",
1213
"react-dom/no-namespace": "error",
@@ -15,7 +16,7 @@ export const rules = {
1516
"react-dom/no-unknown-property": "warn",
1617
"react-dom/no-unsafe-iframe-sandbox": "warn",
1718
"react-dom/no-unsafe-target-blank": "warn",
18-
"react-dom/no-void-elements-with-children": "warn",
19+
"react-dom/no-void-elements-with-children": "error",
1920
} as const satisfies RulePreset;
2021

2122
export const settings = {

packages/plugins/eslint-plugin-react-dom/src/rules/no-flush-sync.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ react-dom/no-flush-sync
1818

1919
`🔍`
2020

21+
**Presets**
22+
23+
- `dom`
24+
- `recommended`
25+
- `recommended-typescript`
26+
- `recommended-type-checked`
27+
2128
## What it does
2229

2330
This rule reports usages of `flushSync`.

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ export const rules = {
88
"@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
99
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
1010
"@eslint-react/dom/no-find-dom-node": "error",
11+
"@eslint-react/dom/no-flush-sync": "error",
1112
"@eslint-react/dom/no-missing-button-type": "warn",
1213
"@eslint-react/dom/no-missing-iframe-sandbox": "warn",
1314
"@eslint-react/dom/no-namespace": "error",
1415
"@eslint-react/dom/no-render-return-value": "error",
1516
"@eslint-react/dom/no-script-url": "warn",
17+
"@eslint-react/dom/no-unknown-property": "warn",
1618
"@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
1719
"@eslint-react/dom/no-unsafe-target-blank": "warn",
18-
"@eslint-react/dom/no-void-elements-with-children": "warn",
20+
"@eslint-react/dom/no-void-elements-with-children": "error",
1921
} as const satisfies RulePreset;
2022

2123
export const plugins = {

0 commit comments

Comments
 (0)