eslint-plugin-github icon indicating copy to clipboard operation
eslint-plugin-github copied to clipboard

[Bug] Bug in `getElementType` logic

Open khiga8 opened this issue 1 year ago • 0 comments

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.

khiga8 avatar May 16 '24 19:05 khiga8