Skip to content

Commit 4e092d6

Browse files
authored
feat(plugins/react-dom): add no-unknown-property, closes #846 (#847)
1 parent 0a847a0 commit 4e092d6

File tree

9 files changed

+1947
-4
lines changed

9 files changed

+1947
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
## v1.16.0 (Wed 30 Oct 2024)
1+
## v1.16.0 (next)
22

33
### ✨ New
44

55
- feat(plugins/react-x): add `jsx-uses-vars`, closes #834 by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/845
6+
- feat(plugins/react-dom): add `no-unknown-property`, closes #846 by @Rel1cx
67

78
### 🪄 Improvements
89

packages/plugins/eslint-plugin-react-dom/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ export default [
3030
rules: {
3131
// react-dom recommended rules
3232
"react-dom/no-children-in-void-dom-elements": "warn",
33-
"react-dom/no-dangerously-set-innerhtml": "warn",
3433
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
34+
"react-dom/no-dangerously-set-innerhtml": "warn",
3535
"react-dom/no-find-dom-node": "error",
3636
"react-dom/no-missing-button-type": "warn",
3737
"react-dom/no-missing-iframe-sandbox": "warn",
3838
"react-dom/no-namespace": "error",
3939
"react-dom/no-render-return-value": "error",
4040
"react-dom/no-script-url": "warn",
41+
"react-dom/no-unknown-property": "warn",
4142
"react-dom/no-unsafe-iframe-sandbox": "warn",
4243
"react-dom/no-unsafe-target-blank": "warn",
4344
},
@@ -50,13 +51,14 @@ export default [
5051
| Rule | Description | 💼 | 💭 | |
5152
| :------------------------------------------- | :-------------------------------------------------------------------------------------- | :-: | :-: | :-: |
5253
| `no-children-in-void-dom-elements` | Prevents the use of `children` in void `DOM elements`. | ✔️ | | |
53-
| `no-dangerously-set-innerhtml` | Prevents `DOM element` using `dangerouslySetInnerHTML`. | 🔒 | | |
5454
| `no-dangerously-set-innerhtml-with-children` | Prevents `DOM element` using `dangerouslySetInnerHTML` and `children` at the same time. | ✔️ | | |
55+
| `no-dangerously-set-innerhtml` | Prevents `DOM element` using `dangerouslySetInnerHTML`. | 🔒 | | |
5556
| `no-find-dom-node` | Prevents usage of `findDOMNode`. || | |
5657
| `no-missing-button-type` | Enforces explicit `type` attribute for `<button>` elements. | ✔️ | | |
5758
| `no-missing-iframe-sandbox` | Enforces explicit `sandbox` attribute for `iframe` elements. | 🔒 | | |
5859
| `no-namespace` | Enforces the absence of a `namespace` in React elements. | ✔️ | | |
5960
| `no-render-return-value` | Prevents usage of the return value of `ReactDOM.render`. || | |
6061
| `no-script-url` | Prevents usage of `javascript:` URLs as the value of certain attributes. | 🔒 | | |
62+
| `no-unknown-property` | Prevents usage of unknown DOM property. | ✔️ | | |
6163
| `no-unsafe-iframe-sandbox` | Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations. | 🔒 | | |
6264
| `no-unsafe-target-blank` | Prevents the use of `target="_blank"` without `rel="noreferrer noopener"`. | 🔒 | | |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import noMissingIframeSandbox from "./rules/no-missing-iframe-sandbox";
1010
import noNamespace from "./rules/no-namespace";
1111
import noRenderReturnValue from "./rules/no-render-return-value";
1212
import noScriptUrl from "./rules/no-script-url";
13+
import noUnknownProperty from "./rules/no-unknown-property";
1314
import noUnsafeIframeSandbox from "./rules/no-unsafe-iframe-sandbox";
1415
import noUnsafeTargetBlank from "./rules/no-unsafe-target-blank";
1516

@@ -44,6 +45,7 @@ export default {
4445
"no-namespace": noNamespace,
4546
"no-render-return-value": noRenderReturnValue,
4647
"no-script-url": noScriptUrl,
48+
"no-unknown-property": noUnknownProperty,
4749
"no-unsafe-iframe-sandbox": noUnsafeIframeSandbox,
4850
"no-unsafe-target-blank": noUnsafeTargetBlank,
4951
},

0 commit comments

Comments
 (0)