Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(eslint-plugin): [no-shadow] report correctly on parameters of functions declared with thedeclare keyword#10543
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Thanks for the PR,@ronami! 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 onhttps://opencollective.com/typescript-eslint. |
nx-cloudbot commentedDec 23, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View yourCI Pipeline Execution ↗ for commita11528b.
☁️Nx Cloud last updated this comment at |
netlifybot commentedDec 23, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
codecovbot commentedDec 23, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #10543 +/- ##==========================================+ Coverage 86.84% 86.90% +0.05%========================================== Files 445 446 +1 Lines 15427 15497 +70 Branches 4497 4514 +17 ==========================================+ Hits 13397 13467 +70 Misses 1675 1675 Partials 355 355
Flags with carried forward coverage won't be shown.Click here to find out more.
|
Uh oh!
There was an error while loading.Please reload this page.
declare keyword
kirkwaiblinger left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good! 🎉🎄
| AST_NODE_TYPES.TSFunctionType, | ||
| AST_NODE_TYPES.TSMethodSignature, | ||
| AST_NODE_TYPES.TSEmptyBodyFunctionExpression, | ||
| AST_NODE_TYPES.TSDeclareFunction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi@ronami IMO,TSConstructSignatureDeclaration andTSConstructorType should also be added, what do you think?
// "ignoreFunctionTypeParameterNameValueShadow": trueconstarg=0;declareconstFoo:{foo:(arg:number)=>void;new(arg:number):void;// 'arg' is already declared in the upper scope on line 2 column 7.}typeBar=new(arg:number)=>void;// 'arg' is already declared in the upper scope on line 2 column 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh, definitely. Thank you@yeonjuan for catching this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@ronami oops. I just edited the comment. I think we should addTSConstructorType also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh, I just went over the list of nodes to make sure I didn't miss anything 🙈
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM! Thanks! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks@yeonjuan for the catch!
JoshuaKGoldberg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
🆒
cde2f97 intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
##### [v8.19.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8191-2025-01-06)##### 🩹 Fixes- **eslint-plugin:** \[no-unnecessary-type-assertion] handle literal types ([#10523](typescript-eslint/typescript-eslint#10523))- **eslint-plugin:** \[no-deprecated] doesn't report on shorthand property in an object expression ([#10550](typescript-eslint/typescript-eslint#10550))- **eslint-plugin:** \[strict-boolean-expressions] remove remaining (unsafe) autofixes ([#10548](typescript-eslint/typescript-eslint#10548))- **eslint-plugin:** \[no-shadow] report correctly on parameters of functions declared with the `declare` keyword ([#10543](typescript-eslint/typescript-eslint#10543))- **eslint-plugin:** \[no-base-to-string] check array generic type ([#10437](typescript-eslint/typescript-eslint#10437))##### ❤️ Thank You- Kirk Waiblinger- mdm317- Ronen Amiel- Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
| datasource | package | from | to || ---------- | -------------------------------- | ------ | ------ || npm | @typescript-eslint/eslint-plugin | 8.19.0 | 8.19.1 || npm | @typescript-eslint/parser | 8.19.0 | 8.19.1 |## [v8.19.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8191-2025-01-06)##### 🩹 Fixes- **eslint-plugin:** \[no-unnecessary-type-assertion] handle literal types ([#10523](typescript-eslint/typescript-eslint#10523))- **eslint-plugin:** \[no-deprecated] doesn't report on shorthand property in an object expression ([#10550](typescript-eslint/typescript-eslint#10550))- **eslint-plugin:** \[strict-boolean-expressions] remove remaining (unsafe) autofixes ([#10548](typescript-eslint/typescript-eslint#10548))- **eslint-plugin:** \[no-shadow] report correctly on parameters of functions declared with the `declare` keyword ([#10543](typescript-eslint/typescript-eslint#10543))- **eslint-plugin:** \[no-base-to-string] check array generic type ([#10437](typescript-eslint/typescript-eslint#10437))##### ❤️ Thank You- Kirk Waiblinger- mdm317- Ronen Amiel- Yukihiro Hasegawa [@y-hsgw](https://github.com/y-hsgw)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
This PR addresses #10539 and adjusts the rule to include the following ways of defining functions (and their parameters) behind the
ignoreFunctionTypeParameterNameValueShadowflag: