eslint / espree

An Esprima-compatible JavaScript parser
BSD 2-Clause "Simplified" License
2.26k stars 189 forks source link

ChainExpression and others are missing in espree.Syntax #531

Closed codeworrior closed 2 years ago

codeworrior commented 2 years ago

According to #331, the espree.Syntax object is supposed to contain all node types supported by Espree. But comparing it with espree.VisitorKeys, the following node types are missing:

ExperimentalRestProperty and ExperimentalSpreadProperty are also missing, but this might be intentional.

For sure one could derive a list of node types from the keys of VisitorKeys, but what's the purpose of the Syntax export then? Shouldn't it be used any longer?

nzakas commented 2 years ago

This was copied over for Esprima compatibility back in the beginning. It appears we haven’t done a good job of keeping it updated. We should probably just base it off of VisitorKeys so the two are always in sync. Would you be interested in submitting a PR for that?