eslint-plugin-compat
eslint-plugin-compat copied to clipboard
Detect use of "sticky" RegExp flag
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
I think this should be closed in favor of the more generic #206 (letting that apply to all ES features).