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

Update: fix false negative in no-use-before-define (fixes #10227) #10396

Merged
merged 2 commits into from
Jun 9, 2018

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented May 24, 2018

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

[X] Bug fix: #10227

What changes did you make? (Give an overview)

This PR does:

  • fixes many false negatives of no-use-before-define rule.
  • remove the accesses to parserOptions from the rule.
  • adds several lacking tests to the rule.

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

The tests for CatchClause and WithStatement were lacking.
Please check the added tests to make a consensus.

@mysticatea mysticatea added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels May 24, 2018
Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

I wonder if we could decompose this PR: First PR would add tests which should pass with current behavior, second would change the logic and show that all tests still pass (as well as adding any new tests that didn't pass before the rule logic change). As it is, right now I can't quite tell what parts of this are new tests and what parts reflect actual changed behavior.

What do you think?

@mysticatea
Copy link
Member Author

I reordered those tests. This PR fixes the former 5 test cases. Those were false negatives. The latter 4 test cases are not changed, but I thought those were lacking, about WithStatement.

Copy link
Member

@platinumazure platinumazure 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!

@kaicataldo kaicataldo merged commit dc4075e into master Jun 9, 2018
@kaicataldo
Copy link
Member

Thanks for contributing!

@platinumazure platinumazure deleted the issue10227 branch June 9, 2018 15:47
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 8, 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 Dec 8, 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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-use-before-define false negative
3 participants