Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

@ronami
Copy link
Member

@ronamironami commentedDec 23, 2024
edited
Loading

PR Checklist

Overview

This PR addresses #10539 and adjusts the rule to include the following ways of defining functions (and their parameters) behind theignoreFunctionTypeParameterNameValueShadow flag:

constarg1=0;declarefunctiontest1(arg1:string):typeofarg1;constarg2=0;declareclassTest3{p2(arg2:string):typeofarg2;}

@typescript-eslint
Copy link
Contributor

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.

@ronamironami changed the titlefix(eslint-plugin): [no-shadow] don't report on parameters of function declaration or function/method overloadsfix(eslint-plugin): [no-shadow] don't report on parameters of function declaration or function/method overload declarationsDec 23, 2024
@nx-cloud
Copy link

nx-cloudbot commentedDec 23, 2024
edited
Loading

View yourCI Pipeline Execution ↗ for commita11528b.

CommandStatusDurationResult
nx test eslint-plugin --coverage=false✅ Succeeded7m 17sView ↗
nx test eslint-plugin✅ Succeeded5m 56sView ↗
nx test type-utils --coverage=false✅ Succeeded25sView ↗
nx test visitor-keys --coverage=false✅ Succeeded3sView ↗
nx run types:build✅ Succeeded<1sView ↗
nx test utils --coverage=false✅ Succeeded6sView ↗
nx test typescript-estree --coverage=false✅ Succeeded1m 12sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded1m 15sView ↗
Additional runs (24)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2024-12-30 17:20:15 UTC

@netlify
Copy link

netlifybot commentedDec 23, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commita11528b
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/6772d1da78251f0008cb1ad4
😎 Deploy Previewhttps://deploy-preview-10543--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 26 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@codecov
Copy link

codecovbot commentedDec 23, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.90%. Comparing base(5a39e0c) to head(a11528b).
Report is 13 commits behind head on main.

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
FlagCoverage Δ
unittest86.90% <ø> (+0.05%)⬆️

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

Files with missing linesCoverage Δ
packages/eslint-plugin/src/rules/no-shadow.ts80.45% <ø> (ø)

... and9 files with indirect coverage changes

@ronamironami changed the titlefix(eslint-plugin): [no-shadow] don't report on parameters of function declaration or function/method overload declarationsfix(eslint-plugin): [no-shadow] don't report on parameters of type-only function declarationsDec 23, 2024
@ronamironami marked this pull request as ready for reviewDecember 23, 2024 20:24
@ronamironami changed the titlefix(eslint-plugin): [no-shadow] don't report on parameters of type-only function declarationsfix(eslint-plugin): [no-shadow] report correctly on parameters of functions declared with thedeclare keywordDec 24, 2024
kirkwaiblinger
kirkwaiblinger previously approved these changesDec 25, 2024
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment
edited
Loading

Choose a reason for hiding this comment

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

Looks good! 🎉🎄

@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelDec 25, 2024
AST_NODE_TYPES.TSFunctionType,
AST_NODE_TYPES.TSMethodSignature,
AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
AST_NODE_TYPES.TSDeclareFunction,
Copy link
Contributor

@yeonjuanyeonjuanDec 30, 2024
edited
Loading

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.

ronami reacted with thumbs up emoji
Copy link
MemberAuthor

@ronamironamiDec 30, 2024
edited
Loading

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 👍

Copy link
Contributor

@yeonjuanyeonjuanDec 30, 2024
edited
Loading

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

ronami reacted with rocket emoji
Copy link
MemberAuthor

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!

yeonjuan reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks! 👍

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!

yeonjuan reacted with heart emoji
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

🆒

@JoshuaKGoldbergJoshuaKGoldberg merged commitcde2f97 intotypescript-eslint:mainDec 31, 2024
62 checks passed
renovatebot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull requestJan 6, 2025
##### [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.
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestJan 6, 2025
| 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.
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJan 8, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

@kirkwaiblingerkirkwaiblingerkirkwaiblinger approved these changes

+1 more reviewer

@yeonjuanyeonjuanyeonjuan left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: [no-shadow] inconsistent reports on function parameter names inside ambient declarations clashing with real variable declarations

4 participants

@ronami@JoshuaKGoldberg@yeonjuan@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp