Skip to content

fix(typescript-estree): include leading and trailing comments & whitespace in Program range - #12991

Merged
bradzacher merged 2 commits into
typescript-eslint:mainfrom
StyleShit:fix/11026-program-range
Oct 13, 2026
Merged

bradzacher merged 2 commits into
typescript-eslint:mainfrom
StyleShit:fix/11026-program-range

Conversation

@StyleShit

Copy link
Copy Markdown
Member

PR Checklist

Overview

Some tests failed in triple-slash-reference, so looking at @bradzacher's comment, I'm not sure this is not a breaking change.

Thoughts?

@typescript-eslint

Copy link
Copy Markdown
Contributor

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.

@netlify

netlify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit a0efe9c
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/6ac77005fd10520008428d2d
😎 Deploy Preview https://deploy-preview-12991--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: 91 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree labels Oct 8, 2026
@nx-cloud

nx-cloud Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a0efe9c

Command Status Duration Result
nx run-many -t typecheck ✅ Succeeded 1m 26s View ↗
nx run-many -t typecheck:tsgo ✅ Succeeded 43s View ↗
nx run-many -t lint --projects=typescript-estre... ✅ Succeeded 1m 14s View ↗
nx run-many -t lint --projects=eslint-plugin --... ✅ Succeeded 1m 5s View ↗
nx run-many -t attw-check --exclude ast-spec we... ✅ Succeeded 9s View ↗
nx run-many -t lint --projects=parser,type-util... ✅ Succeeded 31s View ↗
nx run-many -t lint --projects=ast-spec,utils,s... ✅ Succeeded 24s View ↗
nx run-many -t test --projects=eslint-plugin-in... ✅ Succeeded 4s View ↗
Additional runs (22) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-10-08 10:31:24 UTC

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.85%. Comparing base (bb699d6) to head (a0efe9c).
⚠️ Report is 12 commits behind head on main.

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     
Flag Coverage Δ
ast-spec 69.40% <ø> (ø)
eslint-plugin 94.99% <ø> (+<0.01%) ⬆️
eslint-plugin-internal 69.40% <ø> (ø)
parser 69.40% <ø> (ø)
project-service 78.62% <ø> (-19.11%) ⬇️
repo 78.62% <ø> (-18.88%) ⬇️
rule-schema-to-typescript-types 78.62% <ø> (?)
rule-tester 69.40% <ø> (ø)
scope-manager 69.40% <ø> (ø)
type-utils 78.62% <ø> (?)
types 69.40% <ø> (ø)
typescript-eslint 78.62% <ø> (-18.88%) ⬇️
typescript-estree 54.42% <ø> (ø)
utils 78.62% <ø> (?)
visitor-keys 69.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 58 files with indirect coverage changes

🚀 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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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. 👍

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Oct 12, 2026

@bradzacher bradzacher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah same -- the old behaviour was incorrect and we can talk through with people who explicitly relied on the last setup

@bradzacher
bradzacher merged commit a05e4ee into typescript-eslint:main Oct 13, 2026
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 22, 2026
| 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.
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 22, 2026
| 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.
github-actions Bot pushed a commit to adobe/helix-eslint-config that referenced this pull request Nov 13, 2026
## [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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Parser: End range of Program differs from Espree

3 participants