There appears to be a bug in the getElementType logic.
When the polymorphic prop is set but cannot be interpreted by the linter, the linter falls back to using the value defined in the component map if it is available. This will result in false mappings of components to a value.
The linter should not use the component value at all!
const mapping = {
'Box': 'div'
}
<Box as={something} />
In this case, Box should not fall back to div, and should be skipped by the linter.
There appears to be a bug in the
getElementType
logic.When the polymorphic prop is set but cannot be interpreted by the linter, the linter falls back to using the value defined in the component map if it is available. This will result in false mappings of components to a value.
The linter should not use the component value at all!
In this case,
Box
should not fall back todiv
, and should be skipped by the linter.