UnrefinedBrain / vue-metamorph

Codemod Framework for Vue projects
https://vue-metamorph.dev/
MIT License
72 stars 1 forks source link

isJsx state should also consider the vue component with render method #93

Closed haoliangwu closed 1 month ago

haoliangwu commented 1 month ago

the isJsx here should also consider the following scenario for making @babel/parser support jsx automatically, eg:

<script>
export default {
   render(h) {
      return h(tag, attribute, [
      <bTypography class="bButton-contents" variant={textVariant} component="span">
        {contents}
      </bTypography>,
    ])
   }
}
</script>

anyway, it is probably a edge case here that mixing usage of h and jsx syntax.

UnrefinedBrain commented 1 month ago

does it work if you make it <script lang="jsx"> ?

UnrefinedBrain commented 1 month ago

I don't want to parse everything as jsx all the time, because there's a typescript cast syntax that intersects with jsx, so I made it look for lang="jsx" or lang="tsx" in SFCs to support both cases

haoliangwu commented 1 month ago

@UnrefinedBrain

does it work if you make it Githubissues.

  • Githubissues is a development platform for aggregating issues.