-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Babel-cli docs incorrectly imply that Babel supports generic blob pattern matching in ignore
/only
and such
#9680
Comments
Hey @jcollum-nike! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
This is expected behavior, Babel has extremely minimal support for globs: https://babeljs.io/docs/en/options#matchpattern We literally only global-match when If you want to use more complex glob matching, you can always use a JS config file and pass a function that uses the |
Please reopen because your docs don't say what you are saying here. The docs:
That sure implies that babel Also I feel like you didn't actually look at the package.json in the repo provided |
Fair enough, those docs appear to be outdated.
My previous comment quotes |
src/__mocks__/@company
that is ignored by Glob when given the same patternignore
/only
and such
Well the point is that it's not failing in the glob test -- that's why it's called You have |
Your glob test demonstrates that your ignore using
Looks like it is presently used only for the filenames passed to the CLI, not for anything else.
We explicitly dropped general |
This is incorrect. The glob test shows that all three globs ignore the same files. The initial bug report has the output of the glob test. |
The glob docs don't say anything about it not working on Windows, only that it will interpret |
I think we're referring to different examples. I'm referring to the examples of Babel running with your
where both of them don't ignore the same files, or else the output would be the same.
The docs there state
which means that if a user did |
And that's why it's a bug: of the 3 patterns, all three behave the same way in Glob but only 2 of 3 behave the same way when passed to the Babel CLI. So it's either a bug or the docs need some indication that the globs in Babel don't work the same way as the globs in Glob. Because, considering that Glob is a dependency of this tool it seems very surprising (Principle of Least Surprise after all) that the glob patterns would behave differently in the Babel CLI. |
I agree that the docs need to be updated. I've filed babel/website#1986 since the website docs are not tracked in this repo.
The dependencies of a package really isn't something to depend on when considering functionality, specially since Babel is split across many packages. Making assumptions based on that can lead to confusion exactly like what you're raising here. Gonna close since the doc update is tracked in the other repo, but happy to continue discussing. |
Bug Report
Current Behavior
The file in
src/__mocks__/@company
is processed but Glob will ignore that file when given the same pattern.Input Code
https://github.com/jcollum-nike/babel-glob-bug
Run node glob-test.js:
Then run these commands:
Expected behavior/code
The file in
src/__mocks__/@company
is ignored in all three scenarios when processed with babel CLI.Environment
The text was updated successfully, but these errors were encountered: