You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Callouttype="warning">This is intended to cover edge cases. We suggest to use this option very sparingly, if at all.</Callout>
41
+
<Callouttype="info">Before using `additionalComponents`, consider whether `polymorphicPropName` can be used instead, as it simpler and more efficient.</Callout>
32
42
33
-
A object of aliases for React built-in hooks. ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
43
+
<Callouttype="warning">This is an experimental feature that can be unstable and lacks documentation.</Callout>
An array of components and its attributes mapping. It allows the related rules to do even more comprehensive analysis. You can also provide default values for attributes here, that will be used when that attribute is not present in the component.
36
46
37
-
### `additionalComponents`
47
+
For example, if you set the `additionalComponents` to `[{ name: "EmbedContent", as: "iframe", attributes: [{ name: "sandbox", defaultValue: "" }] }]` then this element:
<Callouttype="info">Before using `additionalComponents`, consider whether `polymorphicPropName` can be used instead, as it simpler and more efficient.</Callout>
51
+
will be evaluated as an `<iframe src="https://eslint-react.xyz" sandbox="" />`
42
52
43
-
<Callouttype="warning">This is an experimental feature that can be unstable and lacks documentation.</Callout>
53
+
So that both the `dom/no-missing-iframe-sandbox` and `dom/no-unsafe-iframe-sandbox` rules can perform checks on it.
44
54
45
-
An array of components and its attributes mapping. It allows the related rules to do even more comprehensive analysis on them than just using the `polymorphicPropName` setting. You can also provide default values for attributes here, that will be used when that attribute is not present in the component.
55
+
### `additionalHooks`
46
56
47
-
(e.g. The `[{ name: "EmbedContent", as: "iframe", attributes: [{ name: "sandbox", defaultValue: "" }] }]` demystifies an `<EmbedContent src="https://eslint-react.xyz" />` as an `<iframe src="https://eslint-react.xyz" sandbox="" />`, so that both the `dom/no-missing-iframe-sandbox` and `dom/no-unsafe-iframe-sandbox` rules can perform checks on it)
57
+
(type: `[key: string]: string[]`)
48
58
49
-
### `importSource`
59
+
<Callouttype="warning">This is intended to cover edge cases. We suggest to use this option very sparingly, if at all.</Callout>
50
60
51
-
(type: `string`, default: `"react"`)
61
+
A object of aliases for React built-in hooks. ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
52
62
53
-
The source where React is imported from.\
54
-
This allows to specify a custom import location for React when not using the official distribution.\
55
-
If `importSource` is specified, an equivalent version of React should be provided to the [`version`](#version) setting.
63
+
For example, if you set the `additionalHooks` to `{ useLayoutEffect: ["useIsomorphicLayoutEffect"] }` then the React Hook in this code:
0 commit comments