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

Consolidate ECMAScript version options #2124

Closed
jugglinmike opened this issue Jan 22, 2015 · 5 comments
Closed

Consolidate ECMAScript version options #2124

jugglinmike opened this issue Jan 22, 2015 · 5 comments

Comments

@jugglinmike
Copy link
Member

Replace boolean options es3, es5, and esnext with a single option named esversion that may be set to 3, 5, or 6. This:

  • precludes invalid configurations like es3: false, es5: true
  • scales better for future versions of ECMAScript
  • eliminates the ambiguity of esnext (whose meaning will change when ES6 is finalized)

This is definitely a breaking change and should be implemented for the next major release of JSHint (if at all).

@nicolo-ribaudo
Copy link
Contributor

Related / duplicated -> #1148

@nicolo-ribaudo
Copy link
Contributor

I'm implementing this option without removing es3, es5 and esnext.

I've two questions:

  1. What does es5: false mean? Is it totally unuseful?
  2. Should esversion: 2015 be a possible value? (synonymous of esversion: 6)

@lukeapage
Copy link
Member

IMO

  1. i think so.. depends what you mean, I assume es5: false, es3: true => esversion: 3, es5: false, esnext:true => Invalid option ?
  2. yes! good thinking.

@nicolo-ribaudo
Copy link
Contributor

esversion: 3, es5: false, esnext:true => Invalid option ?

If JSHint throws an Invalid option warning fot that code, it also should throw it for esnext: true, es3: true, but this would be a breaking change. I think JSHint should silently ignore this invalid configuration ad consider only the last option:

  • esnext: true, es3: true = esversion: 3
  • esversion: 3, es5: false, esnext:true = esversion: 6

i think so.. depends what you mean

I meant this:

// jshint es5: false

var x = {
  get a() {} // es5 syntax, but jshint doesn't warn
};

nicolo-ribaudo added a commit to nicolo-ribaudo/jshint that referenced this issue Jul 2, 2015
This option (which may be set to 3, 5, or 6 / 2015) should replace `es3`, `es5` and `esnext`. This:
- precludes invalid configurations like `es3: false, es5: true`
- scales better for future versions of ECMAScript
- eliminates the ambiguity of `esnext` (whose meaning has changed now that ES6 has been finalized)

This commit partially fixes jshint#2124
nicolo-ribaudo added a commit to nicolo-ribaudo/jshint that referenced this issue Jul 8, 2015
This option (which may be set to 3, 5, or 6 / 2015) should replace `es3`, `es5` and `esnext`. This:
- precludes invalid configurations like `es3: false, es5: true`
- scales better for future versions of ECMAScript
- eliminates the ambiguity of `esnext` (whose meaning has changed now that ES6 has been finalized)

This commit partially fixes jshint#2124
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Aug 8, 2015
This option (which may be set to 3, 5, or 6 / 2015) should replace `es3`, `es5` and `esnext`. This:
- precludes invalid configurations like `es3: false, es5: true`
- scales better for future versions of ECMAScript
- eliminates the ambiguity of `esnext` (whose meaning has changed now that ES6 has been finalized)

This commit partially fixes jshint#2124
nicolo-ribaudo added a commit to nicolo-ribaudo/jshint that referenced this issue Aug 14, 2015
This option (which may be set to 3, 5, or 6 / 2015) should replace `es3`, `es5` and `esnext`. This:
- precludes invalid configurations like `es3: false, es5: true`
- scales better for future versions of ECMAScript
- eliminates the ambiguity of `esnext` (whose meaning has changed now that ES6 has been finalized)

This commit partially fixes jshint#2124
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Sep 20, 2015
This option (which may be set to 3, 5, or 6 / 2015) should replace `es3`, `es5` and `esnext`. This:
- precludes invalid configurations like `es3: false, es5: true`
- scales better for future versions of ECMAScript
- eliminates the ambiguity of `esnext` (whose meaning has changed now that ES6 has been finalized)

This commit partially fixes jshint#2124
@Mouvedia
Copy link

Mouvedia commented May 6, 2016

Couldn't esnext: true become an alias of esversion: 6+?

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

4 participants