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: add shadowed variable loc to message in no-shadow (fixes #13646) #13841

Merged
merged 3 commits into from Jan 30, 2021

Conversation

t-mangoe
Copy link
Contributor

…646)

Prerequisites checklist

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

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

#13646

What changes did you make? (Give an overview)

I changed the no-shadow rule to show where where the original identifier has been defined.

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

I am not familiar with JavaScript, so please check whether my codes have a problem.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Nov 14, 2020
@eslint-deprecated
Copy link

Hi @t-mangoe!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

Read more about contributing to ESLint here

@mdjermanovic mdjermanovic added 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 rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 15, 2020
@mdjermanovic
Copy link
Member

Hi @t-mangoe, thanks for the PR!

The original issue #13646 isn't accepted yet. Per our process, it needs two more 👍 s from team members, so we'll wait to see if it will reach consensus before reviewing.

@t-mangoe
Copy link
Contributor Author

I see. I am waiting.

@btmills btmills 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 Jan 10, 2021
@btmills
Copy link
Member

btmills commented Jan 10, 2021

#13646 is accepted, so I've labeled this as accepted as well.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

@t-mangoe thanks for putting this PR together already! Now that the issue is accepted, let's get it finished up so we can merge it.

I left one idea to improve the message when we don't have location information.

Our contributor license agreement currently thinks you haven't signed it yet. Can you fill it out? If you already have, perhaps it'll catch up when you push another commit to the branch, and if not, let us know and we'll see what's going on.

lib/rules/no-shadow.js Outdated Show resolved Hide resolved
@eslint-deprecated
Copy link

Hi @t-mangoe!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The issue reference must be formatted as follows:

    If the pull request addresses an issue, then the issue number should be mentioned at the end. If the commit doesn't completely fix the issue, then use (refs #1234) instead of (fixes #1234).

    Here are some good commit message summary examples:

    Build: Update Travis to only test Node 0.10 (refs #734)
    Fix: Semi rule incorrectly flagging extra semicolon (fixes #840)
    Upgrade: Esprima to 1.2, switch to using comment attachment (fixes #730)
    

Read more about contributing to ESLint here

@t-mangoe t-mangoe changed the title Update: show where the original identifier has been defined (refs #13… Update: show where the original identifier has been defined (refs #13646) Jan 16, 2021
@eslint-deprecated
Copy link

Hi @t-mangoe!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

Read more about contributing to ESLint here

@t-mangoe t-mangoe changed the title Update: show where the original identifier has been defined (refs #13646) Update: show where the identifier has been defined (refs #13646) Jan 16, 2021
@btmills
Copy link
Member

btmills commented Jan 18, 2021

It looks like your latest push included a bunch of unrelated commits from our master branch. It looks like this pull request should just include just Update: show the original identifier place (refs #13646) and Update: show message when the variable is global (refs #13646). Can you git rebase --interactive on the latest master to include just those two?

@mdjermanovic
Copy link
Member

Merge commit t-mangoe@fdd6444 has two parents that look identical to each other.

@t-mangoe Did you rebase onto the latest master and then pulled from your branch? If so, git pull created that merge commit for the original t-mangoe@f235f99 and its rebased equivalent t-mangoe@2347d4f.

You can write git rebase --onto HEAD~2 HEAD~1 to remove the merge commit (HEAD~1) from ancestors:

$ git status
On branch where-original-identifier
Your branch is up to date with 'origin/where-original-identifier'.

nothing to commit, working tree clean

$ git log -4
commit 6c676213e08277d89af8a85d3445ce5962df57f5 (HEAD -> where-original-identifier, origin/where-original-identifier)
Author: t-mangoe <m.takashi.xpair@gmail.com>
Date:   Sat Jan 16 11:08:51 2021 +0900

    Update: show message when the variable is global (refs #13646)

commit fdd6444ace10115a74d5d461b1f1a2adb8503323
Merge: 2347d4f93 f235f99e2
Author: t-mangoe <m.takashi.xpair@gmail.com>
Date:   Sat Jan 16 11:08:26 2021 +0900

    Merge branch 'where-original-identifier' of https://github.com/t-mangoe/eslint into where-original-identifier

commit 2347d4f93ed6f1994cf5ac3cb5a8d1c41add9e50
Author: t-mangoe <m.takashi.xpair@gmail.com>
Date:   Sat Nov 14 15:00:49 2020 +0900

    Update: show the original identifier place (refs #13646)

commit 6509705a3b8d2542d09d1c22041fe73dd0d0638f
Author: ESLint Jenkins <eslint[bot]@users.noreply.github.com>
Date:   Fri Jan 15 18:00:03 2021 -0500

    7.18.0

$ git rebase --onto HEAD~2 HEAD~1
First, rewinding head to replay your work on top of it...
Applying: Update: show message when the variable is global (refs #13646)

$ git log -3
commit ...some new hash... (HEAD -> where-original-identifier)
Author: t-mangoe <m.takashi.xpair@gmail.com>
Date:   Sat Jan 16 11:08:51 2021 +0900

    Update: show message when the variable is global (refs #13646)

commit 2347d4f93ed6f1994cf5ac3cb5a8d1c41add9e50
Author: t-mangoe <m.takashi.xpair@gmail.com>
Date:   Sat Nov 14 15:00:49 2020 +0900

    Update: show the original identifier place (refs #13646)

commit 6509705a3b8d2542d09d1c22041fe73dd0d0638f
Author: ESLint Jenkins <eslint[bot]@users.noreply.github.com>
Date:   Fri Jan 15 18:00:03 2021 -0500

    7.18.0

$ git push origin where-original-identifier -f

@t-mangoe
Copy link
Contributor Author

@btmills @mdjermanovic
I'm sorry, I rebased onto the master branch by mistake.
I fixed commits by @mdjermanovic 's method , git rebase --onto HEAD~2 HEAD~1.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning that up, much easier to review now. I'm really liking the specific messages for globals vs declared names. Two tiny tweaks then this LGTM. Nice work!

lib/rules/no-shadow.js Outdated Show resolved Hide resolved
lib/rules/no-shadow.js Outdated Show resolved Hide resolved
lib/rules/no-shadow.js Outdated Show resolved Hide resolved
@mdjermanovic mdjermanovic changed the title Update: show where the identifier has been defined (refs #13646) Update: add shadowed variable loc to message in no-shadow (fixes #13646) Jan 30, 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!

This was referenced Mar 17, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jul 30, 2021
@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 Jul 30, 2021
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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
3 participants