feat(ast-spec): change type of UnaryExpression.prefix to always true#12372
Conversation
|
Thanks for the PR, @kirkwaiblinger! 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 7c649e0
☁️ Nx Cloud last updated this comment at |
prefix is always true for UnaryExpressionUnaryExpression.prefix to always true
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (25.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12372 +/- ##
==========================================
- Coverage 86.99% 86.97% -0.02%
==========================================
Files 513 513
Lines 16546 16549 +3
Branches 5165 5166 +1
==========================================
Hits 14394 14394
- Misses 1461 1464 +3
Partials 691 691
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
Yeah makes sense to me!
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.60.0 | 8.61.0 | | npm | @typescript-eslint/parser | 8.60.0 | 8.61.0 | ## [v8.61.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8610-2026-06-08) ##### 🚀 Features - **ast-spec:** change type of `UnaryExpression.prefix` to always `true` ([#12372](typescript-eslint/typescript-eslint#12372)) ##### ❤️ Thank You - Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.61.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.60.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8601-2026-06-01) ##### 🩹 Fixes - **eslint-plugin:** \[no-shadow] correct rule to match ESLint v10 handling ([#12182](typescript-eslint/typescript-eslint#12182)) - **eslint-plugin:** respect ECMAScript line terminators in ts-comment rules ([#12352](typescript-eslint/typescript-eslint#12352)) ##### ❤️ Thank You - lumir - Nevette Bailey [@nevette-bailey](https://github.com/nevette-bailey) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.60.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.

PR Checklist
Overview
Slight restructuring of the type hierarchy in ast-spec...
Right now,
UpdateExpressionandUnaryExpressions have a common base interfaceUnaryExpressionBase, in whichprefixis given asboolean. I'm 90% sure thatUnaryExpressionBaseis not user-visible, and therefore, it is safe to remove it as a common base. If anyone knows, please let me know if that's not true! I've assumed this to be true in this PR, and removed the common base (there's now a base interface for theUnaryExpressions only, that's calledUnaryExpressionBase, but it's still internal).If that assumption is incorrect, I can easily change this PR to keep
UnaryExpressionBaseas is, remaining a common base for theUnaryExpressions andUpdateExpression, but still update the exportedUnaryExpressionunion slightly differently to haveprefix: true.Deprecated
prefixI figured it made sense to add
/** @deprecated */toUnaryExpression'sprefixproperty to discourage reading it and explain that it's alwaystrue, even though it will never be removed. But lmk if that isn't the right move 🤷Other
otherwise there's just minor downstream changes