esdoc / esdoc-plugins

MIT License
140 stars 77 forks source link

Fails to parse short syntax React fragments #81

Open Noldaru opened 5 years ago

Noldaru commented 5 years ago

ESDoc is failing to parse files that contain React fragments in short syntax. (<></>)

warning: could not parse the following code. if you want to use ECMAScript proposals, see https://esdoc.org/manual/feature.html#ecmascript-proposal
/Users/usr1/Code/3dmapping/javascript/packages/console/routes/team/screens/UserTeams.js
128|         ];
129|
130|         return (
131|             <>
132|                 <Row>
133|                     <BackButton fallback={`/users/${this.props.match.params.userId}/profile`}/>
134|                     <PageTitle titleText={["Manage Users", `${user.first_name} ${user.last_name}`, "Teams"]}/>

My configuration is as follows

// .esdoc.json
{
    "source": "./",
    "destination": "./docs",
    "excludes": ["node_modules", "dist", "test", "docs"],
    "package": "./package.json",
    "plugins": [
        {"name": "esdoc-standard-plugin"},
        {"name": "esdoc-ecmascript-proposal-plugin", "option": {"all": true}},
        {"name": "esdoc-react-plugin"},
        {"name": "esdoc-jsx-plugin"}
    ]
}

Babel supports this syntax from version 7 onwards, yet it seems ESDoc fails to recognize it. Other react components not containing this syntax do parse and generate docs without issue.

Lythenas commented 5 years ago

I can confirm this issue.