eslint-plugin-compat icon indicating copy to clipboard operation
eslint-plugin-compat copied to clipboard

Detect use of "sticky" RegExp flag

Open anandthakker opened this issue 4 years ago • 1 comments

IE 11 does not support the "sticky" flag for regular expressions, but eslint-plugin-compat does not seem to detect its use either as /.../y or RegExp('...', 'y')

This would be an especially helpful one to catch, since AFAIK there isn't a readily available polyfill for it. In particular, core-js, which is what Babel uses for polyfills, doesn't support it: https://github.com/zloirock/core-js/issues/372.

Looks like ast-metadata-inferer specifically excludes RegExp entries: https://github.com/amilajack/ast-metadata-inferer/blob/aa3032e68afd950aecfd35590fe6d8618115df01/src/providers/index.js#L28

anandthakker avatar Nov 18 '19 21:11 anandthakker

I think this should be closed in favor of the more generic #206 (letting that apply to all ES features).

brettz9 avatar Apr 01 '20 01:04 brettz9