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

ES2015 aliases for ES6? #6750

Closed
mjomble opened this issue Jul 24, 2016 · 14 comments
Closed

ES2015 aliases for ES6? #6750

mjomble opened this issue Jul 24, 2016 · 14 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint

Comments

@mjomble
Copy link
Contributor

mjomble commented Jul 24, 2016

This is similar to #5169, but in a backwards-compatible way.

Basically, an ability to specify ecmaVersion: 2015 that would behave just like ecmaVersion: 6 without deprecating the value 6.
And an es2015 environment that would just be an alias for the es6 one.

I understand if you think the maintenance overhead from this isn't worth it, but I wanted to check first :)

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 24, 2016
@vitorbal vitorbal added enhancement This change enhances an existing feature of ESLint core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jul 24, 2016
@ljharb
Copy link
Sponsor Contributor

ljharb commented Jul 24, 2016

Since ES7/ES2016 was the last one that was colloquially referred to by the edition number, and ES2017 likely won't be called "ES8", this seems like a good idea - provided that "edition" support stops before edition 15 :-p (and to be safe, edition 9, since ES5 could potentially be referred to as ES2009).

@vitorbal
Copy link
Member

Thanks for reaching out, @mjomble!
I don't know how much maintenance overhead would this imply (not very familiar with that part of the codebase yet), but agreed with @ljharb that this might be a good idea.

However I don't think this would be high in priority for the team since everyone is very focused on JSCS compatibility at the moment.

Would you be willing to work on a PR for this proposal if it gets accepted by the core team?

@mjomble
Copy link
Contributor Author

mjomble commented Jul 24, 2016

I'd be interested in working on a PR, depending on how complex it ends up becoming :)

@vitorbal
Copy link
Member

vitorbal commented Jul 26, 2016

@mjomble Great!
We can accept this issue once someone on the ESLint team champions this and three other people endorse the change (with no one voting against it).
Hopefully we can get more feedback from the rest of the team soon.

@mjomble
Copy link
Contributor Author

mjomble commented Jul 26, 2016

Cool :)

I've had a brief look at the code and having seen many checks like ecmaVersion >= 6, I think the first thing I'd do is add validation to the ecmaVersion option, locking it down to only accept a specific set of values, such as 3, 5, 6, 7, 2015 and 2016 - more could be added in future versions. And after that they could be converted to a normalized comparable form to avoid problems from 2015 being greater than 7, etc.

In theory, this might be a breaking change for anyone out there who for some reason is not using one of these values for ecmaVersion in their config. For example, someone might be currently using ecmaVersion: 8 and it would probably work fine until this value becomes rejected.

@nzakas
Copy link
Member

nzakas commented Jul 26, 2016

@vitorbal that's not accurate. The champion+3 method of decision making is only for rules. For core features, TSC support is required.

Keep in mind that these features come through from Espree, so we'd need to determine whether or not to make changes there or if it makes more sense to make them just in ESLint.

@vitorbal
Copy link
Member

Thanks, @nzakas, sorry for the mix up! I'll have that in mind from now on.

@nzakas
Copy link
Member

nzakas commented Jul 27, 2016

Taking a quick look at the implementation -- escope also uses ecmaVersion, so it's best to normalize in ESLint so (so 2015 is converted to 6 and 2016 is converted to 7) before passing the value to escope or Espree.

I like the idea, will run it by the TSC for input.

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 27, 2016
@nzakas
Copy link
Member

nzakas commented Jul 27, 2016

After a quick offline chat, the TSC is all 👍 for this, so marking as accepted.

@mjomble feel free to submit a pull request

@mjomble
Copy link
Contributor Author

mjomble commented Jul 27, 2016

Excellent, will try to find time for this soon :)

@Mouvedia
Copy link

Mouvedia commented Aug 2, 2016

@ljharb I wouldn't be so sure about that.

It is the eighth edition of the ECMAScript Language Specification.

Only time will tell :)

@ljharb
Copy link
Sponsor Contributor

ljharb commented Aug 2, 2016

@Mouvedia just because editions will continue to be numbered has no bearing on whether people will colloquially use the term "ES8". Indeed, only time will tell.

@alberto
Copy link
Member

alberto commented Aug 15, 2016

@ljharb that's going to be a mess, which I think could be avoided if they were officially called ES15, ES16 (which some people will also use anyways)...

@ljharb
Copy link
Sponsor Contributor

ljharb commented Aug 15, 2016

@alberto unfortunately that ship has sailed.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

No branches or pull requests

7 participants