-
Notifications
You must be signed in to change notification settings - Fork 13
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
Ignore usages that are part of feature test expressions #72
Labels
enhancement
New feature or request
Comments
This is a partly a subset of #29 |
A smaller scope solution could allow users to specify code strings to ignore as a rule option. We might be able to think of many possible ways of doing feature tests, but not all. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If your code (or library code) is using a feature support test conditional statement before using a feature, then you still get an error reported by this plugin. It doesn't know your intent when doing such checks.
The current workaround is to configure the options to say you have a polyfill for that feature, even if you don't. This is dangerous as it will ignore all usages of that feature, including those without a feature test guard. This workaround isn't an option for non-polyfillable features namely BigInt and Atomics, as raised in #70.
It's the responsibility of https://github.com/eslint-community/eslint-plugin-es-x to do the detection. es-compat simply passes through all reports raised by it.
It might be possible to implement something here to guess if an expression looks like a feature test. We have the AST node there. But really eslint-plugin-es-x would be the ideal place for this, as this problem is not unique to es-compat, and it's the root of where the problem arises.
The text was updated successfully, but these errors were encountered: