-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Fix error when parsing ignored files with @babel/eslint-parser
#13338
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/46284/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 23caac0:
|
I'm trying to better understand why When the config is
(I'll clone this PR locally and test it, but you might already have an answer 😁) |
Ok, the source of the problem is that, while the result of A better fix would be to replace function getDefaultParserOptions(options) {
return {
plugins: [],
...options,
babelrc: false,
configFile: false,
browserslistConfigFile: false,
ignore: null,
only: null
};
} |
Ok, of course, the best is to determine the root cause of all these errors 👍 |
@devfservant I noticed that your commits aren't associated to your GitHub account. It doesn't matter for us, but if you want them to be linked to your account you can check https://docs.github.com/en/github/committing-changes-to-your-project/troubleshooting-commits/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
3769db3
to
5e4243b
Compare
…el#13338) * fix(babel-eslint-parser): prevent typeerror in maybeParse * fix(babel-eslint-parser): prevent other typeerrors in convert modules * test(babel-eslint-parser): test maybeParse when file is ignored * refactor(babel-eslint-parser): use fallback options instead of typeerror protections Co-authored-by: devfservant <43757707+devfservant@users.noreply.github.com> Co-authored-by: François Servant <francois.servant.e@thalesdigital.io>
5e4243b
to
23caac0
Compare
@devfservant I linked your commits both to your email (that you use in Git) and to your GitHub autogenerated email, so that they are linked to your account. |
@babel/eslint-parser
@babel/eslint-parser
This PR fixes several parsing errors which occurred in
@babel/eslint-parser
, in particular when a file was ignored.Related issue: #13331
Changes
cc @JLHwung @nicolo-ribaudo @fedeci