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

Unsafe replacement with .startsWith() when doing xo --fix #782

Closed
timlesallen opened this issue Jun 24, 2020 · 4 comments · Fixed by #783
Closed

Unsafe replacement with .startsWith() when doing xo --fix #782

timlesallen opened this issue Jun 24, 2020 · 4 comments · Fixed by #783
Labels

Comments

@timlesallen
Copy link
Contributor

timlesallen commented Jun 24, 2020

/^NN|VB/.test(partOfSpeech) → partOfSpeech.startsWith('NN|VB')

This actually broke my code. :)

I hope I'm filing this in the right place. Or should it rather be under xo?

@timlesallen timlesallen changed the title Unsafe replacement with .startsWith when doing xo --fix Unsafe replacement with .startsWith() when doing xo --fix Jun 24, 2020
@timlesallen timlesallen changed the title Unsafe replacement with .startsWith() when doing xo --fix Unsafe replacement with .startsWith() when doing xo --fix Jun 24, 2020
@fisker fisker added the bug label Jun 24, 2020
@fisker
Copy link
Collaborator

fisker commented Jun 24, 2020

This is the right place.

@fisker
Copy link
Collaborator

fisker commented Jun 24, 2020

Would you like to send a PR fix this? This is easy one, just add | to

['^', '$', '+', '[', '{', '(', '\\', '.', '?', '*']

@timlesallen
Copy link
Contributor Author

@fisker Ok will do.

@timlesallen
Copy link
Contributor Author

@fisker There you go :) #783

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

Successfully merging a pull request may close this issue.

2 participants