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

feat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and parameter location arrays as single-use#9536

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

Merged
JoshuaKGoldberg merged 54 commits intotypescript-eslint:mainfromjfet97:main
Mar 2, 2025

Conversation

jfet97
Copy link
Contributor

@jfet97jfet97 commentedJul 10, 2024
edited by JoshuaKGoldberg
Loading

PR Checklist

Overview

Based on initial work from@danvk, this PR special casesreadonly T[],T[],ReadonlyArray<T>,Array<T> and tuples as single use generic types.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@jfet97!

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.

@netlifyNetlify
Copy link

netlifybot commentedJul 10, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit8a24eca
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67c3eed657a4aa0008c1d6f1
😎 Deploy Previewhttps://deploy-preview-9536--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 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (🟢 up 8 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.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJul 10, 2024
edited
Loading

View yourCI Pipeline Execution ↗ for commit8a24eca.

CommandStatusDurationResult
nx run-many --target=clean✅ Succeeded12sView ↗

☁️Nx Cloud last updated this comment at2025-03-02 05:49:01 UTC

@codecovCodecov
Copy link

codecovbot commentedJul 10, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is84.61538% with2 lines in your changes missing coverage. Please review.

Project coverage is 87.27%. Comparing base(4a58e98) to head(fc006d3).
Report is 223 commits behind head on main.

Current headfc006d3 differs from pull request most recent head8a24eca

Pleaseupload reports for the commit8a24eca to get more accurate results.

Files with missing linesPatch %Lines
...plugin/src/rules/no-unnecessary-type-parameters.ts84.61%0 Missing and 2 partials⚠️

❌ Your patch status has failed because the patch coverage (84.61%) is below the target coverage (90.00%). You can increase the patch coverage or adjust thetarget coverage.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #9536      +/-   ##==========================================+ Coverage   86.76%   87.27%   +0.51%==========================================  Files         444      453       +9       Lines       15311    15841     +530       Branches     4457     4647     +190     ==========================================+ Hits        13285    13826     +541+ Misses       1672     1658      -14- Partials      354      357       +3
FlagCoverage Δ
unittest87.27% <84.61%> (+0.51%)⬆️

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

Files with missing linesCoverage Δ
...plugin/src/rules/no-unnecessary-type-parameters.ts92.16% <84.61%> (-0.24%)⬇️

... and159 files with indirect coverage changes

@danvk

This comment was marked as outdated.

@jfet97

This comment was marked as outdated.

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.

Hey thanks for sending this in & iterating on it! I think the direction here might be a big different from the issue? Did I misread something?

jfet97 reacted with heart emoji
@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelAug 6, 2024
@jfet97

This comment was marked as outdated.

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.

Yup, LGTM - thanks for the iteration!

jfet97 reacted with heart emoji
@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and arrays as a "single use" generic type in functionsfeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and return location arrays as single-useJan 7, 2025
@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and return location arrays as single-usefeat(eslint-plugin): [no-unnecessary-type-parameters] special case readonly tuples and return location arrays as single-useJan 7, 2025
@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(eslint-plugin): [no-unnecessary-type-parameters] special case readonly tuples and return location arrays as single-usefeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and return location arrays as single-useJan 7, 2025
@JoshuaKGoldbergJoshuaKGoldberg removed the awaiting responseIssues waiting for a reply from the OP or another party labelJan 7, 2025
@kirkwaiblingerkirkwaiblinger added the awaiting responseIssues waiting for a reply from the OP or another party labelJan 24, 2025
@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and return location arrays as single-usefeat(eslint-plugin): [no-unnecessary-type-parameters] special case tuples and parameter location arrays as single-useFeb 24, 2025
@kirkwaiblinger
Copy link
Member

kirkwaiblinger commentedFeb 26, 2025
edited
Loading

There's a parenthesization bug around the suggestion fixer - it fixes this:

classJoiner{join<Textendsstring|number>(els:T[]){returnels.map(el=>''+el).join(',');}}

to this:

classJoiner{join(els:string|number[]){returnels.map(el=>''+el).join(',');}}

That might be worsened by this PR due to it now reporting onT[] syntax, but I think it's an existing bug (you could probably come up with a test case with some wonky intersections/unions precedence), so IMO we can handle it in a followup.

kirkwaiblinger
kirkwaiblinger previously approved these changesFeb 26, 2025
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Exciting!

@kirkwaiblingerkirkwaiblinger added 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge and removed awaiting responseIssues waiting for a reply from the OP or another party labelsFeb 26, 2025
@github-actionsgithub-actionsbot removed the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelFeb 27, 2025
@kirkwaiblinger
Copy link
Member

Filed#10894 to follow up on#9536 (comment)

JoshuaKGoldberg reacted with thumbs up 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.

So relieved to have this through 🫠 thanks so much everyone for working on this! 🚀

jfet97 reacted with heart emoji
@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMar 2, 2025
@JoshuaKGoldberg
Copy link
Member

CI failures are unrelated onmain too. 🚢

@JoshuaKGoldbergJoshuaKGoldberg merged commitd8a4fb6 intotypescript-eslint:mainMar 2, 2025
79 of 86 checks passed
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestMar 5, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.26.0 || npm        | @typescript-eslint/parser        | 8.24.0 | 8.26.0 |## [v8.26.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8260-2025-03-03)##### 🚀 Features-   **eslint-plugin:** \[unified-signatures] support ignoring overload signatures with different JSDoc comments ([#10781](typescript-eslint/typescript-eslint#10781))-   **eslint-plugin:** \[explicit-module-boundary-types] add an option to ignore overload implementations ([#10889](typescript-eslint/typescript-eslint#10889))-   **eslint-plugin:** \[no-unused-var] handle implicit exports in declaration files ([#10714](typescript-eslint/typescript-eslint#10714))-   support TypeScript 5.8 ([#10903](typescript-eslint/typescript-eslint#10903))-   **eslint-plugin:** \[no-unnecessary-type-parameters] special case tuples and parameter location arrays as single-use ([#9536](typescript-eslint/typescript-eslint#9536))##### 🩹 Fixes-   **eslint-plugin:** \[no-unnecessary-type-assertion] handle unknown ([#10875](typescript-eslint/typescript-eslint#10875))-   **eslint-plugin:** \[no-invalid-void-type] report `accessor` properties with an invalid `void` type ([#10864](typescript-eslint/typescript-eslint#10864))-   **eslint-plugin:** \[unified-signatures] does not differentiate truly private methods ([#10806](typescript-eslint/typescript-eslint#10806))##### ❤️ Thank You-   Andrea Simone Costa [@jfet97](https://github.com/jfet97)-   Dirk Luijk [@dirkluijk](https://github.com/dirkluijk)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)-   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.## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)##### 🚀 Features-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))##### ❤️ Thank You-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)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.## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)##### 🩹 Fixes-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))##### ❤️ Thank You-   Ronen Amiel-   YeonJuanYou 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 collaboratorsMar 10, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@danvkdanvkdanvk left review comments

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

@kirkwaiblingerkirkwaiblingerkirkwaiblinger left review comments

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.

Enhancement: [no-unnecessary-type-parameters] Special case tuples and parameter arrays as a "single use" generic type
4 participants
@jfet97@danvk@JoshuaKGoldberg@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp