Repository navigation
fix(typescript-estree): include leading and trailing comments & whitespace in Program range - #12991
Conversation
…space in Program range
|
Thanks for the PR, @StyleShit! 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 a0efe9c
☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12991 +/- ##
==========================================
- Coverage 91.59% 90.85% -0.75%
==========================================
Files 480 528 +48
Lines 16670 17492 +822
Branches 5183 5431 +248
==========================================
+ Hits 15269 15892 +623
- Misses 807 974 +167
- Partials 594 626 +32
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
I align with @bradzacher that this is a bugfix, not a breaking change. We can always revert if someone comes out of the woordwork and says they actualy need it the old/incorrect way for some esoteric reason. 👍
bradzacher
left a comment
There was a problem hiding this comment.
yeah same -- the old behaviour was incorrect and we can talk through with people who explicitly relied on the last setup
| datasource | package | from | to | | ---------- | -------------------------------- | ------ | ------ | | npm | @typescript-eslint/eslint-plugin | 8.71.1 | 8.72.0 | | npm | @typescript-eslint/parser | 8.71.1 | 8.72.0 | ## [v8.72.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8720-2026-10-19) ##### 🚀 Features - **eslint-plugin:** \[await-thenable] add `allowMixedPromiseArrays` option ([#12992](typescript-eslint/typescript-eslint#12992)) - **eslint-plugin:** lazy load rules ([#13010](typescript-eslint/typescript-eslint#13010)) ##### 🩹 Fixes - **type-utils:** discriminateAnyType crashes when calling getAwaitedType on awaited type in TS < 5.0 ([#13054](typescript-eslint/typescript-eslint#13054)) - **eslint-plugin:** \[require-array-sort-compare] ignore extra this type argument on TS < 5.1 ([#13055](typescript-eslint/typescript-eslint#13055)) - **eslint-plugin:** \[require-array-sort-compare] check tuples ([#13058](typescript-eslint/typescript-eslint#13058)) - **eslint-plugin:** use isTypeLiteralType instead of type.isLiteral() to include bigint literals on TS < 5.0 ([#13053](typescript-eslint/typescript-eslint#13053)) - **eslint-plugin:** \[no-deprecated] report deprecated properties in object literals ([#12704](typescript-eslint/typescript-eslint#12704)) - **eslint-plugin:** \[prefer-readonly-parameter-types] check where allowed type aliases are declared ([#13016](typescript-eslint/typescript-eslint#13016)) - **typescript-estree:** include leading and trailing comments & whitespace in Program range ([#12991](typescript-eslint/typescript-eslint#12991)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Junichiro Kasuya [@jksy](https://github.com/jksy) - Mitch Fultz [@fitchmultz](https://github.com/fitchmultz) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.72.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.71.2](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8712-2026-10-12) ##### 🩹 Fixes - **eslint-plugin:** \[prefer-optional-chain] safe fix when the chain ends with a strict null comparison ([#12805](typescript-eslint/typescript-eslint#12805)) - **eslint-plugin:** \[no-unnecessary-type-parameters] parenthesize constraint in optional tuple elements ([#12995](typescript-eslint/typescript-eslint#12995)) - **eslint-plugin:** \[no-unused-vars] ignore type-only refs for after-used ([#12977](typescript-eslint/typescript-eslint#12977)) - **eslint-plugin:** \[no-unnecessary-type-parameters] count instantiated mapped type templates ([#12974](typescript-eslint/typescript-eslint#12974)) - **eslint-plugin:** \[no-unused-vars] avoid false-positives when not using our parser ([#12989](typescript-eslint/typescript-eslint#12989)) ##### ❤️ Thank You - Abraham Guo - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Josh Goldberg - Vinccool96 - Younsang Na [@nayounsang](https://github.com/nayounsang) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.2) 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.71.1 | 8.72.0 | | npm | @typescript-eslint/parser | 8.71.1 | 8.72.0 | ## [v8.72.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8720-2026-10-19) ##### 🚀 Features - **eslint-plugin:** \[await-thenable] add `allowMixedPromiseArrays` option ([#12992](typescript-eslint/typescript-eslint#12992)) - **eslint-plugin:** lazy load rules ([#13010](typescript-eslint/typescript-eslint#13010)) ##### 🩹 Fixes - **type-utils:** discriminateAnyType crashes when calling getAwaitedType on awaited type in TS < 5.0 ([#13054](typescript-eslint/typescript-eslint#13054)) - **eslint-plugin:** \[require-array-sort-compare] ignore extra this type argument on TS < 5.1 ([#13055](typescript-eslint/typescript-eslint#13055)) - **eslint-plugin:** \[require-array-sort-compare] check tuples ([#13058](typescript-eslint/typescript-eslint#13058)) - **eslint-plugin:** use isTypeLiteralType instead of type.isLiteral() to include bigint literals on TS < 5.0 ([#13053](typescript-eslint/typescript-eslint#13053)) - **eslint-plugin:** \[no-deprecated] report deprecated properties in object literals ([#12704](typescript-eslint/typescript-eslint#12704)) - **eslint-plugin:** \[prefer-readonly-parameter-types] check where allowed type aliases are declared ([#13016](typescript-eslint/typescript-eslint#13016)) - **typescript-estree:** include leading and trailing comments & whitespace in Program range ([#12991](typescript-eslint/typescript-eslint#12991)) ##### ❤️ Thank You - Evyatar Daud [@StyleShit](https://github.com/StyleShit) - Junichiro Kasuya [@jksy](https://github.com/jksy) - Mitch Fultz [@fitchmultz](https://github.com/fitchmultz) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.72.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.71.2](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8712-2026-10-12) ##### 🩹 Fixes - **eslint-plugin:** \[prefer-optional-chain] safe fix when the chain ends with a strict null comparison ([#12805](typescript-eslint/typescript-eslint#12805)) - **eslint-plugin:** \[no-unnecessary-type-parameters] parenthesize constraint in optional tuple elements ([#12995](typescript-eslint/typescript-eslint#12995)) - **eslint-plugin:** \[no-unused-vars] ignore type-only refs for after-used ([#12977](typescript-eslint/typescript-eslint#12977)) - **eslint-plugin:** \[no-unnecessary-type-parameters] count instantiated mapped type templates ([#12974](typescript-eslint/typescript-eslint#12974)) - **eslint-plugin:** \[no-unused-vars] avoid false-positives when not using our parser ([#12989](typescript-eslint/typescript-eslint#12989)) ##### ❤️ Thank You - Abraham Guo - Brad Zacher [@bradzacher](https://github.com/bradzacher) - Josh Goldberg - Vinccool96 - Younsang Na [@nayounsang](https://github.com/nayounsang) See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.71.2) 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.
## [3.0.34](v3.0.33...v3.0.34) (2026-11-13) ### Bug Fixes * **header:** find header comment independent of Program range ([df8f1e8](df8f1e8)), closes [typescript-eslint/typescript-eslint#12991](typescript-eslint/typescript-eslint#12991)

PR Checklist
Programdiffers from Espree #11026Overview
Some tests failed in
triple-slash-reference, so looking at @bradzacher's comment, I'm not sure this is not a breaking change.Thoughts?