es-check icon indicating copy to clipboard operation
es-check copied to clipboard

Detect use of RegExp `\p` escape sequence

Open glenjamin opened this issue 1 year ago • 3 comments

Requested Update

Detect and warn about use of the \p Regexp escape sequence in unsupported environments

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape

Why Is This Update Needed?

We recently managed to ship broken code after switching from babel to swc because the \p regex escape sequence was being used, and unlike babel swc doesn't translate them - so es-check was unable to warn us that the code would be incompatible

Are There Examples Of This Requested Update Elsewhere?

n/a

glenjamin avatar Feb 22 '24 10:02 glenjamin

@glenjamin can be done, I think! I think we could add this to an optional config file along with several of the other issues here. Do you have time to assist with this? I'm happy to pair back and forth if so. 🙌

Sorry for the slow response btw.

yowainwright avatar Mar 11 '24 05:03 yowainwright

Thanks for the response on this, I ended up switching to https://github.com/eslint-community/eslint-plugin-es-x, which is a bit slower but has more detailed coverage of language and library features

glenjamin avatar Mar 11 '24 08:03 glenjamin

Thanks for the share @glenjamin

yowainwright avatar Mar 11 '24 21:03 yowainwright