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

Custom ecmaVersion #687

Closed
fanatid opened this issue Nov 16, 2016 · 5 comments

Comments

@fanatid
Copy link

commented Nov 16, 2016

It is possible to set custom ecmaVersion in standard section in package.json? I want write package on ES5 and see error from standard if any feature from new ecma versions will be used.

@feross

This comment has been minimized.

Copy link
Member

commented Nov 22, 2016

I am hesitant to add any additional configuration to standard, beyond what we already support. If you want to customize standard, I recommend extending the eslint shared config.

@feross feross closed this Nov 22, 2016

@dcposch

This comment has been minimized.

Copy link

commented Dec 3, 2016

I think this would be useful, too.

If you're running a project that needs to work everywhere without no transpiler, then you want the linter to tell you if you accidentally used an ES6 feature somewhere.

@dcposch

This comment has been minimized.

Copy link

commented Dec 3, 2016

For example, if you want to write a library that can run anywhere: in node, in the browser, in a web worker, then you could use

standard --env=builtin --ecmaVersion=5

...to make sure you're not using any Node globals (eg process), browser globals (eg window), or ES6 features (eg let).

@feross

This comment has been minimized.

Copy link
Member

commented Dec 3, 2016

Re-opening for discussion.

@feross feross reopened this Dec 3, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Apr 4, 2017

This is a cool idea but I think that we're rapidly approaching a world where we'll just start shipping ES6 and even ES7 directly to browsers, since support has gotten really good.

For example, take a look at how much support a feature like const has. 97%. Even super recent features like async functions already has 54% support, and that'll probably be 75% in a few months as Safari and Edge users continue upgrading to the latest version.

Also, we'll maybe eventually do a plugin system (without config!) (discussed in another issue) so that you can do npm install standard standard-es5 && standard and the linter will run with extra rules to force only ES5. This seems like a better approach than adding options to standard.

@feross feross closed this Apr 4, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.