-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Breaking: remove attachComment option #394
Comments
We discussed this in today's TSC meeting and approved it with no objections. Since this doesn't affect ESLint, it doesn't need to wait for a major release of ESLint. Thanks for volunteering to do the work, @kaicataldo! |
FYI I was using it for this project https://github.com/nfroidure/jsarch and faced the issue when bumping. I replaced the default parser by |
@nfroidure espree still parses comments- they're just stored in a comments array rather than attached directly to nodes. You can iterate through all comments pretty easily. Looking for comments "near nodes" is a bit harder, but still possible: If you are using range info on nodes (and tokens and comments), you could get all comments that start before/after the node you're looking at and see all comments that might have been attached to the node in the old comment attachment strategy. You could also look at ESLint's token store utilities to get an idea of how ESLint manages this information internally. |
Ah bummer, I was also using it for |
@benmosher You can still use methods on the |
For those who need this, I have registered the latest Espree with this feature:
|
TSC Summary: Now that ESLint does not use the
attachComment
option and given its buggy nature and maintenance cost, I think we should remove the option from Espree.TSC Question: This is a breaking change, however I suspect that very few other projects are using this option.
I'm more than happy to do the work if this is accepted.
The text was updated successfully, but these errors were encountered: