fix(eslint-plugin): [switch-exhaustiveness-check] always sort literal cases in stable order - #12885
Conversation
|
Thanks for the PR, @JoshuaKGoldberg! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 6341ff6
☁️ Nx Cloud last updated this comment at |
79d5a12 to
6d0f687
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12885 +/- ##
=======================================
Coverage 95.00% 95.00%
=======================================
Files 229 229
Lines 11668 11675 +7
Branches 3877 3876 -1
=======================================
+ Hits 11085 11092 +7
Misses 251 251
Partials 332 332
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
6d0f687 to
16d18bb
Compare
… cases in stable order The rule listed missing cases in whatever order the compiler built the union in, which is neither the declared order nor a sorted one. For a union declared `10 | 2 | 1 | 100 | 20`, TypeScript hands back exactly that, so the report read `10 | 2 | 1 | 100 | 20` and the suggestion wrote its cases in the same jumble. The message and the suggestion could even disagree with each other. Every literal kind now has a place. Strings, numbers, and bigints sort by value, booleans put `false` first, and enum members and unique symbols sort by where they were declared. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KSpN2n5ch3Fqro14mYEqG
16d18bb to
d3c82bf
Compare
…iteral sorting Reuses the existing `getValueOfLiteralType` util instead of hand-rolling the `ts.PseudoBigInt` conversion, and restores the declaration ordering the PR description promises for enum members and unique symbols: `Enum.Up | Enum.Down` rather than the alphabetical `Enum.Down | Enum.Up`. Only string, number, and bigint literals sort by value; every other kind keeps the order it was declared in, which also stops two enums in one union from interleaving. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…by their enum Which of two enums the compiler resolves first depends on the other files in the lint run, so a union of two enums could report and fix in one order for a staged-files lint and another for a full one. Grouping the members by their enum's name pins that down while still leaving each enum's own members in declaration order.
…num case discriminating `Pending, Active, Done` numbered themselves 0, 1, 2, so declaration order happened to match both the numeric order and the alphabetical one and the test would have passed under any of the three. Numbering them out of order pins the declaration ordering down.
…by their printed type Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…es directly Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.69.0 | 8.71.0 | | npm | @typescript-eslint/parser | 8.69.0 | 8.71.0 | ## [v8.71.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8710-2026-09-28) ##### 🚀 Features - **eslint-plugin:** \[no-unsafe-enum-assignment] add rule ([#12732](typescript-eslint/typescript-eslint#12732)) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle a return outside of any function ([#12912](typescript-eslint/typescript-eslint#12912)) - **eslint-plugin:** \[no-unnecessary-type-assertion] specialize generic assertion report message ([#12832](typescript-eslint/typescript-eslint#12832)) - **eslint-plugin:** \[unbound-method] respect `this: void` on class properties ([7fce9127d](typescript-eslint/typescript-eslint@7fce9127d)) - **eslint-plugin:** \[switch-exhaustiveness-check] always sort literal cases in stable order ([#12885](typescript-eslint/typescript-eslint#12885)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Fatih Çakır [@wfatih](https://github.com/wfatih) - Josh Goldberg - Josh Goldberg ✨ - Zamiell [@Zamiell](https://github.com/Zamiell) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8701-2026-09-21) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle multiple Promise constituents ([#12904](typescript-eslint/typescript-eslint#12904)) - **eslint-plugin:** \[no-useless-default-assignment] convert the fixer to a suggestion fixer ([#12826](typescript-eslint/typescript-eslint#12826)) - **eslint-plugin:** \[no-unnecessary-condition] handle union-keyed index access on the left-hand side of nullish assignment ([#12747](typescript-eslint/typescript-eslint#12747)) - **eslint-plugin:** \[unbound-method] treat Intl.Collator.prototype.compare as spec-bound ([#12845](typescript-eslint/typescript-eslint#12845)) - **eslint-plugin:** \[no-unnecessary-parameter-property-assignment] account for parameter reassignment ([#12880](typescript-eslint/typescript-eslint#12880)) - **eslint-plugin:** \[await-thenable] prevent autofix from breaking code when removing `await` ([#12716](typescript-eslint/typescript-eslint#12716)) - **eslint-plugin:** \[no-meaningless-void-operator] allow void on assignment expressions ([#12873](typescript-eslint/typescript-eslint#12873)) - **eslint-plugin:** \[no-unnecessary-type-assertion] false positive for empty object asserted to a type alias of Record ([#12869](typescript-eslint/typescript-eslint#12869)) - **eslint-plugin:** \[no-misused-spread] omit WeakMap spread suggestions ([#12850](typescript-eslint/typescript-eslint#12850)) - **eslint-plugin:** \[no-generated-empty-object-type] don't report a mapped type whose keys are not resolved yet ([#12854](typescript-eslint/typescript-eslint#12854)) - **eslint-plugin:** \[no-explicit-any] use unknown\[] for bare any rest parameters ([#12818](typescript-eslint/typescript-eslint#12818)) - **eslint-plugin:** \[no-unnecessary-type-parameters] handle type precedence in the suggestion fixer ([#12637](typescript-eslint/typescript-eslint#12637)) - **eslint-plugin:** \[no-useless-default-assignment] avoid false positives on tuples with a rest element ([#12768](typescript-eslint/typescript-eslint#12768)) ##### ❤️ Thank You - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Diptajoy Mistry [@diptomistry](https://github.com/diptomistry) - Grit [@Grit03](https://github.com/Grit03) - Hugo [@hugop95](https://github.com/hugop95) - Michael Naumov [@mnaoumov](https://github.com/mnaoumov) - Mikhail Baev [@baevm](https://github.com/baevm) - Om Rawat - Sanath [@sansynx](https://github.com/sansynx) - Shinji - Vinccool96 - 김채영 [@cchaeyoung](https://github.com/cchaeyoung) - 송재욱 See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.1) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8700-2026-09-07) ##### 🚀 Features - **eslint-plugin:** \[no-generated-empty-object-type] add rule ([#12730](typescript-eslint/typescript-eslint#12730)) ##### 🩹 Fixes - **eslint-plugin:** \[no-deprecated] report deprecated imported values used in object shorthand properties ([#12780](typescript-eslint/typescript-eslint#12780)) - **eslint-plugin:** \[no-unnecessary-condition] no false positive on RHS of a nested logical expression ([#12728](typescript-eslint/typescript-eslint#12728)) - **eslint-plugin:** \[member-ordering] don't report fields that read fields declared before them ([#12729](typescript-eslint/typescript-eslint#12729)) ##### ❤️ Thank You - Josh Goldberg ✨ [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg) - Ulrich Stark [@ulrichstark](https://github.com/ulrichstark) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.69.0 | 8.71.0 | | npm | @typescript-eslint/parser | 8.69.0 | 8.71.0 | ## [v8.71.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8710-2026-09-28) ##### 🚀 Features - **eslint-plugin:** \[no-unsafe-enum-assignment] add rule ([#12732](typescript-eslint/typescript-eslint#12732)) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle a return outside of any function ([#12912](typescript-eslint/typescript-eslint#12912)) - **eslint-plugin:** \[no-unnecessary-type-assertion] specialize generic assertion report message ([#12832](typescript-eslint/typescript-eslint#12832)) - **eslint-plugin:** \[unbound-method] respect `this: void` on class properties ([7fce9127d](typescript-eslint/typescript-eslint@7fce9127d)) - **eslint-plugin:** \[switch-exhaustiveness-check] always sort literal cases in stable order ([#12885](typescript-eslint/typescript-eslint#12885)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Fatih Çakır [@wfatih](https://github.com/wfatih) - Josh Goldberg - Josh Goldberg ✨ - Zamiell [@Zamiell](https://github.com/Zamiell) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8701-2026-09-21) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle multiple Promise constituents ([#12904](typescript-eslint/typescript-eslint#12904)) - **eslint-plugin:** \[no-useless-default-assignment] convert the fixer to a suggestion fixer ([#12826](typescript-eslint/typescript-eslint#12826)) - **eslint-plugin:** \[no-unnecessary-condition] handle union-keyed index access on the left-hand side of nullish assignment ([#12747](typescript-eslint/typescript-eslint#12747)) - **eslint-plugin:** \[unbound-method] treat Intl.Collator.prototype.compare as spec-bound ([#12845](typescript-eslint/typescript-eslint#12845)) - **eslint-plugin:** \[no-unnecessary-parameter-property-assignment] account for parameter reassignment ([#12880](typescript-eslint/typescript-eslint#12880)) - **eslint-plugin:** \[await-thenable] prevent autofix from breaking code when removing `await` ([#12716](typescript-eslint/typescript-eslint#12716)) - **eslint-plugin:** \[no-meaningless-void-operator] allow void on assignment expressions ([#12873](typescript-eslint/typescript-eslint#12873)) - **eslint-plugin:** \[no-unnecessary-type-assertion] false positive for empty object asserted to a type alias of Record ([#12869](typescript-eslint/typescript-eslint#12869)) - **eslint-plugin:** \[no-misused-spread] omit WeakMap spread suggestions ([#12850](typescript-eslint/typescript-eslint#12850)) - **eslint-plugin:** \[no-generated-empty-object-type] don't report a mapped type whose keys are not resolved yet ([#12854](typescript-eslint/typescript-eslint#12854)) - **eslint-plugin:** \[no-explicit-any] use unknown\[] for bare any rest parameters ([#12818](typescript-eslint/typescript-eslint#12818)) - **eslint-plugin:** \[no-unnecessary-type-parameters] handle type precedence in the suggestion fixer ([#12637](typescript-eslint/typescript-eslint#12637)) - **eslint-plugin:** \[no-useless-default-assignment] avoid false positives on tuples with a rest element ([#12768](typescript-eslint/typescript-eslint#12768)) ##### ❤️ Thank You - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Diptajoy Mistry [@diptomistry](https://github.com/diptomistry) - Grit [@Grit03](https://github.com/Grit03) - Hugo [@hugop95](https://github.com/hugop95) - Michael Naumov [@mnaoumov](https://github.com/mnaoumov) - Mikhail Baev [@baevm](https://github.com/baevm) - Om Rawat - Sanath [@sansynx](https://github.com/sansynx) - Shinji - Vinccool96 - 김채영 [@cchaeyoung](https://github.com/cchaeyoung) - 송재욱 See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.1) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8700-2026-09-07) ##### 🚀 Features - **eslint-plugin:** \[no-generated-empty-object-type] add rule ([#12730](typescript-eslint/typescript-eslint#12730)) ##### 🩹 Fixes - **eslint-plugin:** \[no-deprecated] report deprecated imported values used in object shorthand properties ([#12780](typescript-eslint/typescript-eslint#12780)) - **eslint-plugin:** \[no-unnecessary-condition] no false positive on RHS of a nested logical expression ([#12728](typescript-eslint/typescript-eslint#12728)) - **eslint-plugin:** \[member-ordering] don't report fields that read fields declared before them ([#12729](typescript-eslint/typescript-eslint#12729)) ##### ❤️ Thank You - Josh Goldberg ✨ [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg) - Ulrich Stark [@ulrichstark](https://github.com/ulrichstark) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.69.0 | 8.71.0 | | npm | @typescript-eslint/parser | 8.69.0 | 8.71.0 | ## [v8.71.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8710-2026-09-28) ##### 🚀 Features - **eslint-plugin:** \[no-unsafe-enum-assignment] add rule ([#12732](typescript-eslint/typescript-eslint#12732)) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle a return outside of any function ([#12912](typescript-eslint/typescript-eslint#12912)) - **eslint-plugin:** \[no-unnecessary-type-assertion] specialize generic assertion report message ([#12832](typescript-eslint/typescript-eslint#12832)) - **eslint-plugin:** \[unbound-method] respect `this: void` on class properties ([7fce9127d](typescript-eslint/typescript-eslint@7fce9127d)) - **eslint-plugin:** \[switch-exhaustiveness-check] always sort literal cases in stable order ([#12885](typescript-eslint/typescript-eslint#12885)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Fatih Çakır [@wfatih](https://github.com/wfatih) - Josh Goldberg - Josh Goldberg ✨ - Zamiell [@Zamiell](https://github.com/Zamiell) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8701-2026-09-21) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle multiple Promise constituents ([#12904](typescript-eslint/typescript-eslint#12904)) - **eslint-plugin:** \[no-useless-default-assignment] convert the fixer to a suggestion fixer ([#12826](typescript-eslint/typescript-eslint#12826)) - **eslint-plugin:** \[no-unnecessary-condition] handle union-keyed index access on the left-hand side of nullish assignment ([#12747](typescript-eslint/typescript-eslint#12747)) - **eslint-plugin:** \[unbound-method] treat Intl.Collator.prototype.compare as spec-bound ([#12845](typescript-eslint/typescript-eslint#12845)) - **eslint-plugin:** \[no-unnecessary-parameter-property-assignment] account for parameter reassignment ([#12880](typescript-eslint/typescript-eslint#12880)) - **eslint-plugin:** \[await-thenable] prevent autofix from breaking code when removing `await` ([#12716](typescript-eslint/typescript-eslint#12716)) - **eslint-plugin:** \[no-meaningless-void-operator] allow void on assignment expressions ([#12873](typescript-eslint/typescript-eslint#12873)) - **eslint-plugin:** \[no-unnecessary-type-assertion] false positive for empty object asserted to a type alias of Record ([#12869](typescript-eslint/typescript-eslint#12869)) - **eslint-plugin:** \[no-misused-spread] omit WeakMap spread suggestions ([#12850](typescript-eslint/typescript-eslint#12850)) - **eslint-plugin:** \[no-generated-empty-object-type] don't report a mapped type whose keys are not resolved yet ([#12854](typescript-eslint/typescript-eslint#12854)) - **eslint-plugin:** \[no-explicit-any] use unknown\[] for bare any rest parameters ([#12818](typescript-eslint/typescript-eslint#12818)) - **eslint-plugin:** \[no-unnecessary-type-parameters] handle type precedence in the suggestion fixer ([#12637](typescript-eslint/typescript-eslint#12637)) - **eslint-plugin:** \[no-useless-default-assignment] avoid false positives on tuples with a rest element ([#12768](typescript-eslint/typescript-eslint#12768)) ##### ❤️ Thank You - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Diptajoy Mistry [@diptomistry](https://github.com/diptomistry) - Grit [@Grit03](https://github.com/Grit03) - Hugo [@hugop95](https://github.com/hugop95) - Michael Naumov [@mnaoumov](https://github.com/mnaoumov) - Mikhail Baev [@baevm](https://github.com/baevm) - Om Rawat - Sanath [@sansynx](https://github.com/sansynx) - Shinji - Vinccool96 - 김채영 [@cchaeyoung](https://github.com/cchaeyoung) - 송재욱 See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.1) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8700-2026-09-07) ##### 🚀 Features - **eslint-plugin:** \[no-generated-empty-object-type] add rule ([#12730](typescript-eslint/typescript-eslint#12730)) ##### 🩹 Fixes - **eslint-plugin:** \[no-deprecated] report deprecated imported values used in object shorthand properties ([#12780](typescript-eslint/typescript-eslint#12780)) - **eslint-plugin:** \[no-unnecessary-condition] no false positive on RHS of a nested logical expression ([#12728](typescript-eslint/typescript-eslint#12728)) - **eslint-plugin:** \[member-ordering] don't report fields that read fields declared before them ([#12729](typescript-eslint/typescript-eslint#12729)) ##### ❤️ Thank You - Josh Goldberg ✨ [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg) - Ulrich Stark [@ulrichstark](https://github.com/ulrichstark) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.69.0 | 8.71.0 | | npm | @typescript-eslint/parser | 8.69.0 | 8.71.0 | ## [v8.71.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8710-2026-09-28) ##### 🚀 Features - **eslint-plugin:** \[no-unsafe-enum-assignment] add rule ([#12732](typescript-eslint/typescript-eslint#12732)) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle a return outside of any function ([#12912](typescript-eslint/typescript-eslint#12912)) - **eslint-plugin:** \[no-unnecessary-type-assertion] specialize generic assertion report message ([#12832](typescript-eslint/typescript-eslint#12832)) - **eslint-plugin:** \[unbound-method] respect `this: void` on class properties ([7fce9127d](typescript-eslint/typescript-eslint@7fce9127d)) - **eslint-plugin:** \[switch-exhaustiveness-check] always sort literal cases in stable order ([#12885](typescript-eslint/typescript-eslint#12885)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Fatih Çakır [@wfatih](https://github.com/wfatih) - Josh Goldberg - Josh Goldberg ✨ - Zamiell [@Zamiell](https://github.com/Zamiell) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8701-2026-09-21) ##### 🩹 Fixes - **eslint-plugin:** \[no-misused-promises] handle multiple Promise constituents ([#12904](typescript-eslint/typescript-eslint#12904)) - **eslint-plugin:** \[no-useless-default-assignment] convert the fixer to a suggestion fixer ([#12826](typescript-eslint/typescript-eslint#12826)) - **eslint-plugin:** \[no-unnecessary-condition] handle union-keyed index access on the left-hand side of nullish assignment ([#12747](typescript-eslint/typescript-eslint#12747)) - **eslint-plugin:** \[unbound-method] treat Intl.Collator.prototype.compare as spec-bound ([#12845](typescript-eslint/typescript-eslint#12845)) - **eslint-plugin:** \[no-unnecessary-parameter-property-assignment] account for parameter reassignment ([#12880](typescript-eslint/typescript-eslint#12880)) - **eslint-plugin:** \[await-thenable] prevent autofix from breaking code when removing `await` ([#12716](typescript-eslint/typescript-eslint#12716)) - **eslint-plugin:** \[no-meaningless-void-operator] allow void on assignment expressions ([#12873](typescript-eslint/typescript-eslint#12873)) - **eslint-plugin:** \[no-unnecessary-type-assertion] false positive for empty object asserted to a type alias of Record ([#12869](typescript-eslint/typescript-eslint#12869)) - **eslint-plugin:** \[no-misused-spread] omit WeakMap spread suggestions ([#12850](typescript-eslint/typescript-eslint#12850)) - **eslint-plugin:** \[no-generated-empty-object-type] don't report a mapped type whose keys are not resolved yet ([#12854](typescript-eslint/typescript-eslint#12854)) - **eslint-plugin:** \[no-explicit-any] use unknown\[] for bare any rest parameters ([#12818](typescript-eslint/typescript-eslint#12818)) - **eslint-plugin:** \[no-unnecessary-type-parameters] handle type precedence in the suggestion fixer ([#12637](typescript-eslint/typescript-eslint#12637)) - **eslint-plugin:** \[no-useless-default-assignment] avoid false positives on tuples with a rest element ([#12768](typescript-eslint/typescript-eslint#12768)) ##### ❤️ Thank You - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Diptajoy Mistry [@diptomistry](https://github.com/diptomistry) - Grit [@Grit03](https://github.com/Grit03) - Hugo [@hugop95](https://github.com/hugop95) - Michael Naumov [@mnaoumov](https://github.com/mnaoumov) - Mikhail Baev [@baevm](https://github.com/baevm) - Om Rawat - Sanath [@sansynx](https://github.com/sansynx) - Shinji - Vinccool96 - 김채영 [@cchaeyoung](https://github.com/cchaeyoung) - 송재욱 See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.1) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. ## [v8.70.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8700-2026-09-07) ##### 🚀 Features - **eslint-plugin:** \[no-generated-empty-object-type] add rule ([#12730](typescript-eslint/typescript-eslint#12730)) ##### 🩹 Fixes - **eslint-plugin:** \[no-deprecated] report deprecated imported values used in object shorthand properties ([#12780](typescript-eslint/typescript-eslint#12780)) - **eslint-plugin:** \[no-unnecessary-condition] no false positive on RHS of a nested logical expression ([#12728](typescript-eslint/typescript-eslint#12728)) - **eslint-plugin:** \[member-ordering] don't report fields that read fields declared before them ([#12729](typescript-eslint/typescript-eslint#12729)) ##### ❤️ Thank You - Josh Goldberg ✨ [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg) - Ulrich Stark [@ulrichstark](https://github.com/ulrichstark) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.


PR Checklist
accepting prsOverview
switch-exhaustiveness-checkcurrently adds missing cases based on whatever the compiler gives back. Which in tests used to be one ordering (roughly alphabetical), but with TS7.1 /stableTypeOrderingcan now be different.The rule needs to not be different in TS 5/6 vs. TS 7 /
stableTypeOrdering. Both in general to not confuse users or be inconvenient when they upgrade, and so that our own test suites in #12803 show the same rule reports.This PR changes the rule to manually sort missing cases using the existing naive
typeToString.💖