-
-
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
Import babel-plugin-transform-dotall-regex #7059
Conversation
PTAL @thejameskyle. Feel free to edit the patch directly — especially for small nits that’s much easier/faster for everyone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please run prettier on the code? make fix
It seems that tests are failing but i'm not sure it's related to your PR actually.
import path from 'path'; | ||
import fs from 'fs'; | ||
import assert from 'assert'; | ||
import { transform, transformFileSync } from '@babel/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transform
is not used, we can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@xtuc Thanks! Patch updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to change the test file to match the other packages, don't need the file anymore and use the helper pkg
@hzoo Thanks; I’ve changed |
@mathiasbynens There are a few things that needs to be changed in the tests:
You can look for a good example at https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex/test |
@nicolo-ribaudo Thanks for pointing to that example. I’ve updated the patch. As a side comment, I’m struggling to understand how the |
## Installation | ||
|
||
```sh | ||
$ npm install @babel/plugin-transform-dotall-regex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--save-dev
Yeah, you are right... I think that it is some sort of tecnichal debt that no one ever cared about fixing. PS. Still |
Yeah we should refactor the tests to just be input/output files or something, it's always been actual/expected and it's confusing |
@mathiasbynens updated the readme, and the tests |
Made #7063 @mathiasbynens |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6248/ |
Original: https://github.com/mathiasbynens/babel-plugin-transform-dotall-regex Moving it into the official Babel repository makes it easier to maintain the transform.
After we land this, I have a small follow-up PR that will enable this in preset-env as well |
@mathiasbynens thanks! :P |
We’ll also want to start thinking about preset-es2018, which would include this transform. |
Thanks for the help, everyone! ♥ |
We are going to stop making yearly presets since we have preset-env now 😄 |
That’s even better news! 🎉 |
Original: https://github.com/mathiasbynens/babel-plugin-transform-dotall-regex
Moving it into the official Babel repository makes it easier to maintain the transform.