Skip to content

Fix bug in getElementType logic #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 20, 2024
Prev Previous commit
Next Next commit
update code comment
  • Loading branch information
khiga8 committed May 16, 2024
commit e6f3c9e639d19370f07c21528277eea3fd52d09d
5 changes: 3 additions & 2 deletions lib/utils/get-element-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ function getElementType(context, node, lazyElementCheck = false) {
// check if the node contains a polymorphic prop
const polymorphicPropName = settings?.github?.polymorphicPropName ?? 'as'

let checkConditionalMap = true

const prop = getProp(node.attributes, polymorphicPropName)
const literalPropValue = getLiteralPropValue(getProp(node.attributes, polymorphicPropName))
let checkConditionalMap = true

// If the prop is not a literal and we cannot determine it, don't fall back to the conditional map value, if it exists
if (prop && !literalPropValue) {
checkConditionalMap = false
}
Expand Down
Loading