Skip to content

Conversation

@dmichon-msft
Copy link
Contributor

Summary

Fixes a regression in heft-lint-plugin for ESLint@>=9 where the TypeScript program from the compiler was no longer being reused, resulting in a full duplicate parse and analysis of the source code.

Details

The toJSON override was marking the programs property on languageOptions.parserOptions non-enumerable (rather than returning an alternative representation without the property), causing the config finalization step that clones the object to discard the property.

How it was tested

Ran the local build test projects with rule violations to verify that linting still occurs. Used the CPU profiler to verify that the program was not recreated.

Impacted documentation

None.

Copy link
Member

@bmiddha bmiddha left a comment

Choose a reason for hiding this comment

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

:shipit:

@dmichon-msft dmichon-msft enabled auto-merge (squash) November 4, 2025 00:40
@dmichon-msft
Copy link
Contributor Author

dmichon-msft commented Nov 4, 2025

Apparently there is another code path that tries to process this object, but it is only hit in 4 of our build test projects and not anywhere else...

Edit: the languageOptionsToJSON support for custom toJSON was added in ESLint 9.28.0, and these test projects use ESLint ~9.25.1

@dmichon-msft dmichon-msft merged commit cc1d835 into microsoft:main Nov 4, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Nov 4, 2025
@dmichon-msft dmichon-msft deleted the fix-program-reuse branch November 4, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants