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

feat: Normalize ecmaVersion to eslint-scope when using custom parser #15268

Merged
merged 2 commits into from Nov 9, 2021
Merged

feat: Normalize ecmaVersion to eslint-scope when using custom parser #15268

merged 2 commits into from Nov 9, 2021

Conversation

ota-meshi
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Add something to the core

Fixes #15256

What changes did you make? (Give an overview)

Change to pass 6 to eslint-scope when ecmaVersion is non number.
This allows the scope to be analyzed as ES6 if the user uses a custom parser and ecmaVersion: latest.

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Nov 6, 2021
@aladdin-add aladdin-add added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint 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 Nov 7, 2021
Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic 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 Nov 8, 2021
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@nzakas nzakas merged commit 0338fd2 into eslint:main Nov 9, 2021
@ljharb
Copy link
Sponsor Contributor

ljharb commented Nov 9, 2021

What happens when the ecmaVersion is unset?

@ota-meshi ota-meshi deleted the eslint-scope branch November 9, 2021 02:04
@ota-meshi
Copy link
Member Author

Analyze the scope as ES5 as before.

https://github.com/eslint/eslint/pull/15268/files#diff-d07305285d4aba653258416cfdca2a0a54de623ac619a96d3b6a7146e371833cR4167-R4172

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 9, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 9, 2022
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

Successfully merging this pull request may close these issues.

Change Request: If ecmaVersion: latest pass ecmaVersion: 6 to eslint-scope
5 participants