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

skipAttributesThatMatchRegex config needs to use strings in JSON #228

Closed
hmajoros opened this issue Jan 10, 2020 · 1 comment · Fixed by #229
Closed

skipAttributesThatMatchRegex config needs to use strings in JSON #228

hmajoros opened this issue Jan 10, 2020 · 1 comment · Fixed by #229

Comments

@hmajoros
Copy link
Contributor

When trying to use

skipAttributesThatMatchRegex: [/data-/gim, /aria-/gim],

in your config file, this is invalid JSON and the codemod will complain.

When changing this to be valid JSON, like

skipAttributesThatMatchRegex: ["/data-/gim", "/aria-/gim"],

now the rx.test() no longer works since String.test() is not a function

return config.skipAttributesThatMatchRegex.some(rx => rx.test(key));

I think we should be parsing the RegExp from a string in the code snippet above, and changing the README to ensure that regexp's are passed as a string value

@suchitadoshi1987 FYI

@suchitadoshi1987
Copy link
Contributor

👍 thank you @hmajoros will fix this shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants