Closed edoardocavazza closed 1 month ago
This must not be done by default, since that's not how react (the original, default, and most common usage of jsx) works.
I think a global setting should be used to map htmlFor
to for
, and rules updated to respect that setting - that way, custom renderers can map whatever attributes they want.
In most of the rendering engine, both for
(as attribute) and htmlFor
(as property) are valid. Maybe the global setting should be an array of property names to check?
React's is the primary one that matters since it has almost the entirety of the usage, but it's good to design the schema so it can support all the renderers.
how about an object, which defaults to { for: ['htmlFor'], 'class': ['className'] }
etc, and then you can set it to any combination you want?
I think it would fit a lot, but I have some issues creating the test cases for the settings :(
I’d prefer to reuse this PR (but now that you’ve opened a second one, please keep both open)
This PR introduces support for
for
attribute as equivalent for thehtmlFor
property.Related issues: #894, #961