Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Removed incorrect options#17458

Open
liuxingbaoyu wants to merge 1 commit intobabel:mainfrom
liuxingbaoyu:fix-sourceFileName
Open

Removed incorrect options#17458
liuxingbaoyu wants to merge 1 commit intobabel:mainfrom
liuxingbaoyu:fix-sourceFileName

Conversation

@liuxingbaoyu
Copy link
Member

Q                       A
Fixed Issues? #17404 (comment)
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I found that it wasn't as difficult as I'd imagined.
It seems the best approach is to just remove it.
Another approach is to use sourceFilename: sourceFileName. This didn't break our tests, but it adds the filename property to every node.loc, which might affect performance.

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59788

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 31, 2025

Open in StackBlitz

commit: c33a035

@JLHwung
Copy link
Contributor

JLHwung commented Jul 31, 2025

AFAIK some third-party plugins explicitly depend on this parser option. Removing it would certainly break them. We tried to unify it with another option a few years ago but then it was reverted.

@nicolo-ribaudo
Copy link
Member

We tried doing something related in Babel 7 (#13532), but then had to revert (#13732) because it broke a bunch of plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants