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

ES6 features (e.g. generators) not being tested against browsers #206

Open
niftylettuce opened this issue Mar 21, 2019 · 6 comments
Open

Comments

@niftylettuce
Copy link

Generators for example don't throw an error for IE11 https://kangax.github.io/compat-table/es6/#test-generators

@niftylettuce niftylettuce changed the title ES6 features not being tested against browsers ES6 features (e.g. generators) not being tested against browsers Mar 21, 2019
@YOU54F
Copy link

YOU54F commented Apr 30, 2019

Hey @amilajack for the great work so far,

Quick question - Is kangax supported currently or is it still TODO?

A couple of tools which have fallen out of maintainence, that check kangax that may be worth looking at to help with incorporating with this tool, if it would be preferable

https://github.com/kamilogorek/compat-cli
https://github.com/jgardella/compat

@amilajack
Copy link
Owner

@YOU54F we're mostly trying to check browser API features at the moment. Usually ES features can either be polyfilled. It is often that browser APIs do not have polyfills so we're trying to focus on those first. Since babel-polyfill can be used for polyfilling, this is a lower priority.

@benmosher
Copy link

I can imagine having two separate rules: compat/apis vs. compat/syntax. Would be neat.

I also am mostly looking for linting of APIs since babel-preset-env handles pretty much every modern syntax enhancement, but as more and more of the syntaxes are natively supported, it'd be neat to have this plugin check syntaxes also. Probably pretty straightforward as there are probably often direct mappings between modern features and ESTree node types.

@wehrstedt
Copy link

@YOU54F we're mostly trying to check browser API features at the moment. Usually ES features can either be polyfilled. It is often that browser APIs do not have polyfills so we're trying to focus on those first. Since babel-polyfill can be used for polyfilling, this is a lower priority.

I run into a similar problem. I used arrow functions and for...of but its not supported for IE 11. The plugin should check syntax, too. In my envorinment it's not possible to use transpilers

@wehrstedt
Copy link

wehrstedt commented Jun 21, 2019

I added https://github.com/mysticatea/eslint-plugin-es to disallow some es6 features for my needs. Isnt it possible to extend this plugin here?

@ljharb
Copy link
Collaborator

ljharb commented Jun 21, 2019

You don’t need an eslint plugin. Just set ecmaVersion to what you’re targeting, and use no-restricted-syntax if you need to block a subset.

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

No branches or pull requests

6 participants