Skip to content
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

Regex support #61

Closed
zslabs opened this issue Feb 6, 2019 · 3 comments
Closed

Regex support #61

zslabs opened this issue Feb 6, 2019 · 3 comments

Comments

@zslabs
Copy link
Contributor

zslabs commented Feb 6, 2019

Thanks for creating this! Instead of an array of values; have you ever considered adding support for regex expressions as well? A lot of our selectors (for Cypress) start with data-test- but then vary based on their implementation. We have a few hundred; so it'd be great if we could allocate a namespace to be removed in prod since they are used exclusively for testing.

Thanks again!

@oliviertassinari
Copy link
Owner

@zslabs I have no objection with your feature request.

@divmgl
Copy link
Contributor

divmgl commented Feb 6, 2019

We'll likely just need to extend this block to support a regex rather than using indexOf.

https://github.com/oliviertassinari/babel-plugin-react-remove-properties/blob/master/src/index.js#L26

@zslabs
Copy link
Contributor Author

zslabs commented Feb 6, 2019

@divmgl Was nice enough to create a PR #62

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

No branches or pull requests

3 participants