-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose acorn plugin from espree module #623
Comments
The fact that Espree is currently implemented as an Acorn plugin doesn't mean it always will be, so it doesn't make sense to export the Acorn plugin from the However, I've been thinking it might be helpful to look at creating a different package that is more of general "ESLint Acorn plugin" that formats Acorn results in the way ESLint wants them. Espree could then use that, with any additional modifications necessary to get the full Espree experience. That would require a bit of thought, though, as it wouldn't make sense just to take the entire current Espree Acorn plugin and expose that. @eslint/eslint-team what do you think about this idea? |
I'd be perfectly happy if there was another package that exposed an "ESLint Acorn plugin", rather than exposing it from this package. For context: I have a use case at work where we build a custom Acorn parser with specific behaviors, then we re-use that parser for ESLint. Right now we depend on |
@molisani thanks, that's very helpful context, and I think is a vote in favor of exposing the "ESLint Acorn plugin" separately to allow for people to build custom parsers with Acorn that can be used with ESLint. |
Ping @eslint/eslint-tsc |
I like the idea of an Acorn plugin, but to be honest I don't understand what is specific to Espree that is not also specific to ESLint, or was specific to ESLint at some point in time. So I'm not sure what the general "ESLint Acorn plugin" should expose if not the entire current Espree Acorn plugin, as the OP suggested. I'd be happy to comment on a more detailed proposal. |
I'd need to look more closely, but basically it would be Espree without JSX support or |
Per TSC meeting on 2024-10-17, @mdjermanovic will look more closely into this so the team can make a decision on next steps. |
I'm in favor of extracting an ESLint Acorn plugin into a separate package 👍 |
Marking as accepted. I'll plan on taking a look at this after the CSS and YAML plugins, so if anyone else wants to take a look first, please be my guest. |
The
espree
parser is defined as a plugin for the Acorn parser. This plugin used to be accessible viaespree/lib/espree.js
, but this is now an internal module and cannot be imported directly.Could this value be exported from the package? Something like
export const acornPlugin = espree;
The text was updated successfully, but these errors were encountered: