Closed mysticatea closed 4 years ago
@marijnh @RReverser Would you take a look at this PR?
@RReverser Would you be open to moving the npm package to the acorn
org, so that I can publish updates? I'm unlikely to seriously maintain it, but I'm willing to merge and publish PRs like this one.
I still don't really understand this change on either Acorn side or Acorn-JSX side, but if you're happy with it and it helps, it's fine by me.
@marijnh Done (I think).
I'm not sure if I'm in that org though?
@rreverser It seems our org is called acornjs
, not acorn
(sorry)... and now this org has it. Can you still reassign that or should I contact the owner of that org and ask if they reassign it?
I would immediately email npm support about that one.
Well, this finally got released (5.1.0) just now
Thank you very much!
This PR updates
acorn-jsx
to useParser.acorn
property thatacorn@7.1.0
added. This is to solve the problem https://github.com/acornjs/acorn/pull/870 describes.The
require("acorn-jsx").tokTypes
property is as-is, the JSX token types for theacorn
of the peer dependency.This PR adds a static property
acornJsx
to the enhancedParser
class.That static property exposes the actual JSX token types to other plugins that want to modify JSX tokens. The
JsxParser.acornJsx
andrequire("acorn-jsx").tokTypes
are the same instance in most situation. But those can be different in the special situation https://github.com/acornjs/acorn/pull/870 describes.Espree will use the
JsxParser.acornJsx
to modify tokens.