jquery / esprima

ECMAScript parsing infrastructure for multipurpose analysis
http://esprima.org
BSD 2-Clause "Simplified" License
7.04k stars 786 forks source link

JSX Identify the problem #2107

Open enjoy-wind opened 2 years ago

enjoy-wind commented 2 years ago

React class component arrow function cannot be recognized.

Example Content:

import React from 'react'

class test extends React.Component{ constructor(props) { super(props); this.state = { } }

initData = (item) =>{ }

render() { return (

) } }

export default connect(mapStateToProps)(LinkageSwitchItem)

Steps to reproduce

esprima.parse('some code')

Expected output

Actual output

Relevant references

jogibear9988 commented 2 years ago

maybe try my fork, esprima-next

enjoy-wind commented 2 years ago

I have fixed this issue myself, what attempts to support VUE.

jogibear9988 commented 2 years ago

I've seen your commit, but it could happen again, and I don't see much development here...