Closed scalvert closed 6 years ago
Thanks for reporting! It might be possible to check the value of the variable, so to only opt out of transforming this when the value contains a non-standard selector. Will have to give this a try...
This is exactly what I was thinking too. LMK if you want help.
Currently, if a jQuery selector is represented via a variable:
the codemod will optimistically transform this to:
This will result in a Syntax Error when running the tests, as
querySelector
can't handle the custom pseudo selectors sizzle supports.A conservative approach would be to noop if encountering a selector in a variable.