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

fix(eslint-plugin): [no-shadow] fix false-positive on enum declaration #2374

Merged
merged 1 commit into from Aug 8, 2020

Conversation

@bradzacher
Copy link
Member

@bradzacher bradzacher commented Aug 8, 2020

Fixes #2360

@bradzacher bradzacher added the bug label Aug 8, 2020
@typescript-eslint
Copy link

@typescript-eslint typescript-eslint bot commented Aug 8, 2020

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@bradzacher bradzacher linked an issue that may be closed by this pull request Aug 8, 2020
@codecov
Copy link

@codecov codecov bot commented Aug 8, 2020

Codecov Report

Merging #2374 into v4 will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##               v4    #2374   +/-   ##
=======================================
  Coverage   92.98%   92.99%           
=======================================
  Files         286      286           
  Lines        9041     9046    +5     
  Branches     2515     2517    +2     
=======================================
+ Hits         8407     8412    +5     
  Misses        304      304           
  Partials      330      330           
Flag Coverage Δ
#unittest 92.99% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/no-shadow.ts 98.52% <100.00%> (+0.11%) ⬆️
@bradzacher bradzacher merged commit 62c0fb5 into v4 Aug 8, 2020
11 checks passed
11 checks passed
Typecheck
Details
Unit tests Unit tests
Details
Code style and lint
Details
Run integration tests on primary Node.js version
Details
Run unit tests on other Node.js versions (10.x)
Details
Run unit tests on other Node.js versions (14.x)
Details
Publish the latest code as a canary version
Details
Publish the latest code as a v4 prerelease version
Details
Semantic Pull Request ready to be squashed
Details
codecov/patch 100.00% of diff hit (target 90.00%)
Details
codecov/project 92.99% (+0.00%) compared to 3529589
Details
@bradzacher bradzacher deleted the 2360-no-shadow-bug branch Aug 8, 2020
bradzacher added a commit that referenced this pull request Aug 9, 2020
bradzacher added a commit that referenced this pull request Aug 10, 2020
bradzacher added a commit that referenced this pull request Aug 19, 2020
bradzacher added a commit that referenced this pull request Aug 29, 2020
@bradennapier
Copy link

@bradennapier bradennapier commented Sep 1, 2020

did this regress or is it not released yet? all enums report no-shadow for me still on latest versions of everything.

@Kenadia
Copy link

@Kenadia Kenadia commented Sep 1, 2020

did this regress or is it not released yet? all enums report no-shadow for me still on latest versions of everything.

@bradennapier You may need to set the following rules:

'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
@derekparsons718
Copy link

@derekparsons718 derekparsons718 commented Sep 4, 2020

It's unfortunate that the changelog does not indicate that the no-shadow rule was added. This PR is listed as a bugfix in the changelog, and makes it sound like the bug was simply fixed, instead of indicating that a new rule must be added to your config:

image

Not sure if this is something you want to address, but as more people make the switch to v4 I think it would help to have the changelog show that there is a new rule that replaces eslint's no-shadow -- probably in the "features" section of v4.0.0, the same way that consistent-type-imports is listed as a new rule.

There have already been several issues created because users don't know that the new rule is available when they upgrade.

@bradzacher
Copy link
Member Author

@bradzacher bradzacher commented Sep 4, 2020

The changelog is just an auto-generated log of commits bundled in each release.

Prefer the github release notes which are curated and explain in detail:
https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0

I'll add a link to this doc. I kinda want to just delete these files though as they're just noise.

There have already been several issues created because users don't know that the new rule is available when they upgrade

There's a larger problem with users not using the search. It's a huge problem with github as a whole.

@derekparsons718
Copy link

@derekparsons718 derekparsons718 commented Sep 4, 2020

Totally makes sense. I just didn't realize that was where I needed to look, and apparently at least a few other people had the same problem, so I thought I would point it out :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.