[utils] [patch] Fix @babel/eslint-parser
8 compatibility
#2343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Babel 8, you won't be able to directly require
@babel/eslint-parser/worker/ast-info.cjs
anymore (there is a reason if the path contains "worker": it's meant to be used in workers after properly setting them up 😛). However,@babel/eslint-parser
exposes thevisitorKeys
on its result object, similarly to how@typescript-eslint/parser
does: you can access it without requiring any internal file.We caught this in our integration tests: even if for some reason the error is logged without reporting a failure, in https://app.circleci.com/pipelines/github/babel/babel/8764/workflows/3516a741-7bca-4713-8b12-9f2f20310066/jobs/50483/parallel-runs/0/steps/0-103 you can see
There aren't any tests for
@babel/eslint-parser
, and I'm not sure about how to add them from scratch because it requires ababel.config.json
file when used witheslint-plugin-import
(to specify which additional syntax should be supported, such as TS). However, I verified manually that this change makes our test pass.