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-conversion] add rule#10182

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 46 commits intotypescript-eslint:mainfromskondrashov:main
May 5, 2025

Conversation

skondrashov
Copy link
Contributor

@skondrashovskondrashov commentedOct 20, 2024
edited
Loading

PR Checklist

Overview

Shows autofixable errors for:

// setupletstr="string";constnum=1;constbool=true;constbig=BigInt(1);// begin invalid casesString("hello");"hello".toString();""+"hello";"hello"+"";String(1+"");(1+"").toString();""+(1+"");1+""+"";String(str);str.toString();""+str;str+"";str+="";Number(+"1");+(+"1");~~+"1";Number(num);+num;~~num;Boolean(bool);!!bool;BigInt(big);

with the following error messaging:

   9:2  error  Passing a string to String() does not change the type or value of the string            @typescript-eslint/no-unnecessary-coercion  10:9  error  Using .toString() on a string does not change the type or value of the string           @typescript-eslint/no-unnecessary-coercion  11:2  error  Concatenating '' with a string does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  12:9  error  Concatenating a string with '' does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  14:2  error  Passing a string to String() does not change the type or value of the string            @typescript-eslint/no-unnecessary-coercion  15:9  error  Using .toString() on a string does not change the type or value of the string           @typescript-eslint/no-unnecessary-coercion  16:2  error  Concatenating '' with a string does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  17:8  error  Concatenating a string with '' does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  19:2  error  Passing a string to String() does not change the type or value of the string            @typescript-eslint/no-unnecessary-coercion  20:5  error  Using .toString() on a string does not change the type or value of the string           @typescript-eslint/no-unnecessary-coercion  21:2  error  Concatenating '' with a string does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  22:5  error  Concatenating a string with '' does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  23:5  error  Concatenating a string with '' does not change the type or value of the string          @typescript-eslint/no-unnecessary-coercion  25:2  error  Passing a number to Number() does not change the type or value of the number            @typescript-eslint/no-unnecessary-coercion  26:2  error  Using the unary + operator on a number does not change the type or value of the number  @typescript-eslint/no-unnecessary-coercion  27:2  error  Using ~~ on a number does not change the type or value of the number                    @typescript-eslint/no-unnecessary-coercion  29:2  error  Passing a number to Number() does not change the type or value of the number            @typescript-eslint/no-unnecessary-coercion  30:2  error  Using the unary + operator on a number does not change the type or value of the number  @typescript-eslint/no-unnecessary-coercion  31:2  error  Using ~~ on a number does not change the type or value of the number                    @typescript-eslint/no-unnecessary-coercion  33:2  error  Passing a boolean to Boolean() does not change the type or value of the boolean         @typescript-eslint/no-unnecessary-coercion  34:2  error  Using !! on a boolean does not change the type or value of the boolean                  @typescript-eslint/no-unnecessary-coercion  36:2  error  Passing a bigint to BigInt() does not change the type or value of the bigint            @typescript-eslint/no-unnecessary-coercion

Does not (and should not) show errors for:

// setupletstr=Math.random()>0.5 ?"string" :1;constnum=Math.random()>0.5 ?1 :"1";constbool=Math.random()>0.5 ?true :1;constbig=Math.random()>0.5 ?BigInt(1) :1;// begin valid casesString(str);str.toString();`${str}`;""+str;str+"";str+="";newString("asdf");Number(num);+num;~~num;~1;Boolean(bool);!!bool;!false;BigInt(big);

Does not do anything with Symbol() because everything weird I tried to do with symbols was already a typescript error.

Does not do anything for some conversions to number which are already forbidden by typescript ("The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), including:

"123"*1;"123"/1;"123"-0;"123"|0;

Does not cover${"123"}, because that overlaps with theno-unnecessary-template-expression rule. Need feedback on what to do about that.

I went with the word "coercion" because it was chosen by@Josh-Cena in the original issue but I think it's a poor choice. I think "conversion" or even "type conversion idiom" might be the most precise, because.toString() for example doesn't rely on coercion, and while!!value and!value both coerce the type ofvalue to a boolean, it's the property of the idiom!! that it can be used for type conversion which puts it under the umbrella of this rule. So I thinkno-unnecessary-type-conversion is a better name for this rule, given the things that I'm currently having it check for.

Catches the following problems in this repository (separate commit):

typescript-eslint\packages\eslint-plugin\src\rules\adjacent-overload-signatures.ts  79:21  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coercion  97:21  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\explicit-function-return-type.ts  170:27  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coercion  177:9   error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\member-ordering.ts  492:14  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\no-duplicate-enum-values.ts  50:21  error  Passing a string to String() does not change the type or value of the string  @typescript-eslint/no-unnecessary-coercion  52:21  error  Passing a number to Number() does not change the type or value of the number  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\no-empty-interface.ts  84:44  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\no-redundant-type-constituents.ts  176:10  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\no-unnecessary-template-expression.ts   22:24  error  Passing a string to String() does not change the type or value of the string  @typescript-eslint/no-unnecessary-coercion  174:22  error  Passing a string to String() does not change the type or value of the string  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\no-unsafe-assignment.ts  202:17  error  Passing a string to String() does not change the type or value of the string  @typescript-eslint/no-unnecessary-coerciontypescript-eslint\packages\eslint-plugin\src\rules\prefer-return-this-type.ts  64:14  error  Using !! on a boolean does not change the type or value of the boolean  @typescript-eslint/no-unnecessary-coercion

Might not have the best placement for the error scope, and might not have the best formatting for autofixes, could use feedback on those too.

kirkwaiblinger, HarryHighPants, jdufresne, fregante, and patrykszwed reacted with thumbs up emoji
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@skondrashov!

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 commentedOct 20, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit6822a69
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/68166b5ec9ca820008470ef2
😎 Deploy Previewhttps://deploy-preview-10182--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: 97 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (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.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedOct 20, 2024
edited
Loading

View yourCI Pipeline Execution ↗ for commit6822a69.

CommandStatusDurationResult
nx test eslint-plugin✅ Succeeded6m 6sView ↗
nx run eslint-plugin:test -- --coverage✅ Succeeded6m 21sView ↗
nx test eslint-plugin --coverage=false✅ Succeeded5m 5sView ↗
nx run-many --target=lint --exclude eslint-plugin✅ Succeeded1m 20sView ↗
nx test visitor-keys✅ Succeeded1sView ↗
nx run types:build✅ Succeeded1sView ↗
nx typecheck ast-spec✅ Succeeded2sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded7sView ↗
Additional runs (26)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-05-03 19:28:41 UTC

@skondrashov
Copy link
ContributorAuthor

skondrashov commentedOct 20, 2024
edited
Loading

Sorry for force-push, wasn't sure how else to resolve the merge conflicts other than redoing the commit cause they didn't show up locally. Doesn't seem like it did anything to the merge conflict though, so I'm out of ideas.

I see I have problems from the perfectionist plugin in my files as well, but the plugin doesn't run locally when I useyarn lint, so I don't know what to do about that either.

Would be happy to address the 2 missing lines of coverage at some point if everything else gets figured out.

@codecovCodecov
Copy link

codecovbot commentedOct 20, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.90%. Comparing base(bca8a91) to head(6822a69).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #10182      +/-   ##==========================================+ Coverage   90.84%   90.90%   +0.06%==========================================  Files         497      498       +1       Lines       50320    50655     +335       Branches     8311     8335      +24     ==========================================+ Hits        45714    46049     +335  Misses       4591     4591                Partials       15       15
FlagCoverage Δ
unittest90.90% <100.00%> (+0.06%)⬆️

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

Files with missing linesCoverage Δ
packages/eslint-plugin/src/configs/eslintrc/all.ts100.00% <100.00%> (ø)
...lugin/src/configs/eslintrc/disable-type-checked.ts100.00% <100.00%> (ø)
packages/eslint-plugin/src/configs/flat/all.ts100.00% <100.00%> (ø)
...nt-plugin/src/configs/flat/disable-type-checked.ts100.00% <100.00%> (ø)
...t-plugin/src/rules/adjacent-overload-signatures.ts100.00% <100.00%> (ø)
...-plugin/src/rules/explicit-function-return-type.ts100.00% <100.00%> (ø)
...ackages/eslint-plugin/src/rules/member-ordering.ts99.20% <100.00%> (ø)
...slint-plugin/src/rules/no-duplicate-enum-values.ts100.00% <100.00%> (ø)
...ages/eslint-plugin/src/rules/no-empty-interface.ts100.00% <100.00%> (ø)
...plugin/src/rules/no-redundant-type-constituents.ts97.64% <100.00%> (ø)
... and5 more
🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kirkwaiblinger
Copy link
Member

kirkwaiblinger commentedOct 21, 2024
edited
Loading

// setupletstr=Math.random()>0.5 ?"string" :1;constnum=Math.random()>0.5 ?1 :"1";constbool=Math.random()>0.5 ?true :1;constbig=Math.random()>0.5 ?BigInt(1) :1;

(hint) - We often usedeclare to do this sort of setup for demo purposes, i.e.

// setupdeclareletstr:string|number;declareconstnum:number|string;// etc

It's a useful pattern for testing sometimes too, since you may run into surprising behavior whenconst t = true; has typetrue rather than typeboolean. Nothing specifically requested, just letting you know about another tool for your kit in case it comes in handy during discussion on this PR 🙂

Does not do anything with Symbol() because everything weird I tried to do with symbols was already a typescript error.

Makes sense 👍

Does not do anything for some conversions to number which are already forbidden by typescript ("The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), including:

"123"*1;"123"/1;"123"-0;"123"|0;

Yep, also makes sense. And, even if TS did allow them, we don't need to stress about identifying every possible way for a value to be coerced, just the common patterns, and others can always be added in the future, too. Appreciate your close attention to detail on all these, though!

Does not cover${"123"}, because that overlaps with theno-unnecessary-template-expression rule. Need feedback on what to do about that.

This is an astute observation. Is there anything this rule would flag that that rule doesn't flag? If not, I'd lean towards letting that separate rule handle this case. If you want you could even put a note in the docs that tells the user that template expressions intentionally aren't handled because they're already dealt with more thoroughly in theno-unnecessary-template-expression rule.

I went with the word "coercion" because it was chosen by@Josh-Cena in the original issue but I think it's a poor choice. I think "conversion" or even "type conversion idiom" might be the most precise, because.toString() for example doesn't rely on coercion, and while!!value and!value both coerce the type ofvalue to a boolean, it's the property of the idiom!! that it can be used for type conversion which puts it under the umbrella of this rule. So I thinkno-unnecessary-type-conversion is a better name for this rule, given the things that I'm currently having it check for.

Hmm, I hear you. I personally think either one is fine. Maybe someone else will care more strongly 🤷

Might not have the best placement for the error scope, and might not have the best formatting for autofixes, could use feedback on those too.

I think for these reports, reporting the whole node is totally fine

declareconsts:string;s+'';~~~~~~!!(longExpressionThatsABoolean);~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But, I really like what you've done with the more granular approach.

!!(longExpressionThatsABoolean);~~

So I'd say go for it! But if it becomes an implementation hassle, no stress either if you end up falling back to the typical strategy of letting thenode dictate the report.

skondrashov reacted with thumbs up emoji

@kirkwaiblinger
Copy link
Member

Sorry for force-push...

No worries! The real pain is just force pushing between reviews, not before a reviewer has looked at it at all 🙂.

..., wasn't sure how else to resolve the merge conflicts other than redoing the commit cause they didn't show up locally.

Oh, so I think the trouble that you're having is that you've used themain branch on your fork. The "usual" vanilla workflow would be

  1. fork typescript-eslint. The main branch of your fork points to the HEAD of main of the original typescript-eslintat the time the fork was made.
  2. Create a branch for your feature, work on there.
  3. Whenever you need to synchronize upstream changes, use the github UI or CLI to synchronize the changes on typescript-eslint's main with your fork's main. Then merge those into your branch.

But you're in a slightly awkward scenario since your branch is on main. What I personally do (which differs from the above) is to set a second remote on your local repo, i.e.git remote add upstream git@github.com:typescript-eslint/typescript-eslint.git. Then you cangit fetch --all && git checkout upstream/main (or similar) to make a branch from there, to merge changes into your PR branch. There's... (too) many ways to address this, good ol git, haha.

LMK if this helps or if you'd like some more help. (I can also push things directly to your branch to bail you out if needed 🤣). And no stress if you end up doing a force push again this time to get yourself in a clean state here!

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.

This is great work! And especially impressive considering it's your first PR to typescript-eslint. Well done!

Requesting a few changes, but nothing major.

🙂

@Josh-Cena
Copy link
Member

I went with the word "coercion" because it was chosen by@Josh-Cena in the original issue but I think it's a poor choice. I think "conversion" or even "type conversion idiom" might be the most precise, because.toString() for example doesn't rely on coercion, and while!!value and!value both coerce the type ofvalue to a boolean, it's the property of the idiom!! that it can be used for type conversion which puts it under the umbrella of this rule. So I thinkno-unnecessary-type-conversion is a better name for this rule, given the things that I'm currently having it check for.

Agreed; let's go withno-unnecessary-type-conversion instead.

skondrashov reacted with thumbs up emoji

@kirkwaiblingerkirkwaiblinger added the awaiting responseIssues waiting for a reply from the OP or another party labelNov 11, 2024
@JoshuaKGoldberg
Copy link
Member

👋 Just checking in@skondrashov - is this still something you have time and energy for?

@JoshuaKGoldbergJoshuaKGoldberg added the stalePRs or Issues that are at risk of being or have been closed due to inactivity for a prolonged period labelDec 14, 2024
@skondrashov
Copy link
ContributorAuthor

I'll have time to finish up the changes probably early in the new year!

kirkwaiblinger reacted with hooray emojikirkwaiblinger reacted with heart emoji

@JoshuaKGoldberg
Copy link
Member

Awesome! I'll move this to draft then in the meantime, so we don't bug you. 🚀

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as draftDecember 21, 2024 14:50
kirkwaiblinger
kirkwaiblinger previously approved these changesMay 1, 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.

I think I'm happy with this! Thanks for your very detailed work on this. Outstanding first PR!

skondrashov reacted with hooray emojiskondrashov and ulrichstark reacted with rocket emoji
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMay 1, 2025
@kirkwaiblingerkirkwaiblinger requested a review froma teamMay 1, 2025 15:36
@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 labelMay 1, 2025
kirkwaiblinger
kirkwaiblinger previously approved these changesMay 2, 2025
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMay 2, 2025
@kirkwaiblingerkirkwaiblinger requested a review froma teamMay 2, 2025 14:32
@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 labelMay 2, 2025
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMay 2, 2025
@JoshuaKGoldberg
Copy link
Member

I amsalivating at how many existing violations were removed in this PR. 🤤

kirkwaiblinger reacted with laugh emojikirkwaiblinger reacted with heart emoji

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesMay 2, 2025
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.

Awesome, this is looking very good! A stellar first PR indeed 🏆. Thanks for pushing on this!

Just a few small things from me - nothing we can't just do before merge if you don't have the time.

@@ -4,7 +4,6 @@ import rule from '../../src/rules/await-thenable';
import { getFixturesRootDir } from '../RuleTester';

const rootDir = getFixturesRootDir();
const messageId = 'await';

Choose a reason for hiding this comment

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

Nit: it would be nice to have these split out into their own PR. I'm not going to block on this though.

@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 labelMay 5, 2025
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMay 5, 2025
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.

Red wavy text with gradient yellow to reddish orange 3d effect: "WONDERFUL"

skondrashov and ntnyq reacted with heart emoji
@JoshuaKGoldbergJoshuaKGoldberg merged commitccbfcdc intotypescript-eslint:mainMay 5, 2025
59 checks passed
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestMay 10, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.31.0 | 8.32.0 || npm        | @typescript-eslint/parser        | 8.31.0 | 8.32.0 |## [v8.32.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8320-2025-05-05)##### 🚀 Features-   **eslint-plugin:** \[only-throw-error] add option `allowRethrowing` ([#11075](typescript-eslint/typescript-eslint#11075))-   **eslint-plugin:** \[no-unnecessary-type-conversion] add rule ([#10182](typescript-eslint/typescript-eslint#10182))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] fix parenthesization bug in suggestion ([#11098](typescript-eslint/typescript-eslint#11098))-   **eslint-plugin:** \[unified-signatures] exempt `this` from optional parameter overload check ([#11005](typescript-eslint/typescript-eslint#11005))-   **eslint-plugin:** \[no-unnecessary-type-parameters] should parenthesize type in suggestion fixer if necessary ([#10907](typescript-eslint/typescript-eslint#10907))##### ❤️ Thank You-   Andy Edwards-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)-   mdm317-   Sasha Kondrashov-   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.31.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8311-2025-04-28)##### 🩹 Fixes-   **eslint-plugin:** \[no-unnecessary-condition] downgrade fix to suggestion ([#11081](typescript-eslint/typescript-eslint#11081))##### ❤️ Thank You-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)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 requestMay 10, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.31.0 | 8.32.0 || npm        | @typescript-eslint/parser        | 8.31.0 | 8.32.0 |## [v8.32.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8320-2025-05-05)##### 🚀 Features-   **eslint-plugin:** \[only-throw-error] add option `allowRethrowing` ([#11075](typescript-eslint/typescript-eslint#11075))-   **eslint-plugin:** \[no-unnecessary-type-conversion] add rule ([#10182](typescript-eslint/typescript-eslint#10182))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] fix parenthesization bug in suggestion ([#11098](typescript-eslint/typescript-eslint#11098))-   **eslint-plugin:** \[unified-signatures] exempt `this` from optional parameter overload check ([#11005](typescript-eslint/typescript-eslint#11005))-   **eslint-plugin:** \[no-unnecessary-type-parameters] should parenthesize type in suggestion fixer if necessary ([#10907](typescript-eslint/typescript-eslint#10907))##### ❤️ Thank You-   Andy Edwards-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)-   mdm317-   Sasha Kondrashov-   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.31.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8311-2025-04-28)##### 🩹 Fixes-   **eslint-plugin:** \[no-unnecessary-condition] downgrade fix to suggestion ([#11081](typescript-eslint/typescript-eslint#11081))##### ❤️ Thank You-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)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 requestMay 11, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.31.0 | 8.32.0 || npm        | @typescript-eslint/parser        | 8.31.0 | 8.32.0 |## [v8.32.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8320-2025-05-05)##### 🚀 Features-   **eslint-plugin:** \[only-throw-error] add option `allowRethrowing` ([#11075](typescript-eslint/typescript-eslint#11075))-   **eslint-plugin:** \[no-unnecessary-type-conversion] add rule ([#10182](typescript-eslint/typescript-eslint#10182))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] fix parenthesization bug in suggestion ([#11098](typescript-eslint/typescript-eslint#11098))-   **eslint-plugin:** \[unified-signatures] exempt `this` from optional parameter overload check ([#11005](typescript-eslint/typescript-eslint#11005))-   **eslint-plugin:** \[no-unnecessary-type-parameters] should parenthesize type in suggestion fixer if necessary ([#10907](typescript-eslint/typescript-eslint#10907))##### ❤️ Thank You-   Andy Edwards-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)-   mdm317-   Sasha Kondrashov-   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.31.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8311-2025-04-28)##### 🩹 Fixes-   **eslint-plugin:** \[no-unnecessary-condition] downgrade fix to suggestion ([#11081](typescript-eslint/typescript-eslint#11081))##### ❤️ Thank You-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)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 collaboratorsMay 13, 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

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.

Rule proposal: no-unnecessary-coercion
6 participants
@skondrashov@kirkwaiblinger@Josh-Cena@JoshuaKGoldberg@jdufresne@fregante

[8]ページ先頭

©2009-2025 Movatter.jp