[heft-lint-plugin] Lint files selected by ESLint flat config - #6006
Draft
Ian Clanton-Thuon (iclanton) wants to merge 3 commits into
Draft
[heft-lint-plugin] Lint files selected by ESLint flat config#6006Ian Clanton-Thuon (iclanton) wants to merge 3 commits into
Ian Clanton-Thuon (iclanton) wants to merge 3 commits into
Conversation
Ian Clanton-Thuon (iclanton)
force-pushed
the
fix/heft-lint-flat-config-files
branch
from
September 5, 2026 00:02
1f1edde to
bca4d92
Compare
Use ESLint's native flat-config enumeration to find files outside the TypeScript program, then lint them through the existing cache and reporting pipeline. Exclude TypeScript emit folders and cover the behavior with the ESLint 9 SARIF fixture.
The lint plugin imports the TypeScript configuration loader at runtime. Publish that dependency and update both affected subspace lockfiles so isolated build-test installations can load the plugin.
Ian Clanton-Thuon (iclanton)
force-pushed
the
fix/heft-lint-flat-config-files
branch
from
September 5, 2026 00:05
bca4d92 to
54eb97a
Compare
Keep the TypeScript plugin as an accessor-only development dependency and exclude ESLint's built-in JavaScript extensions from the additional-file pass. Partition SARIF metadata by ESLint instance and classify the new lint behavior as a minor release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Heft lint plugin currently sends ESLint only files from the TypeScript program. As a result, files selected exclusively by ESLint flat config, such as Markdown or JSON, are never linted.
This change uses ESLint's native flat-config enumeration to find configured extensions outside the TypeScript program and runs them through the plugin's existing cache, fix, diagnostic, and SARIF pipeline.
Details
For ESLint 9, the plugin creates a discovery-only ESLint instance and calls
lintFiles()with rules disabled. TypeScript program roots and primary TypeScript emit directories are excluded from discovery. ESLint's built-in JavaScript extensions (.js,.mjs, and.cjs) are excluded from the additional-file pass because ESLint enumerates them even when flat config did not introduce them; this also prevents build outputs produced by other Heft tasks from becoming new lint inputs. Extensions introduced by flat config, such as Markdown, JSON, JSX, or custom language extensions, remain discoverable.Discovered files are linted with a separate ESLint instance so the TypeScript
Programparser override is not applied to non-program files. They are then included in the existing per-file content/config cache and result reporting. SARIF metadata is collected from the ESLint instance that created each result. In builds with multiple TypeScript programs, additional files are included only once.ESLint 8 and TSLint behavior is unchanged. The extra rule-free enumeration has a performance cost, but delegates flat-config matching and ignore semantics to ESLint instead of reimplementing them.
How it was tested
All tests were run against commit
0cb1dd40b0.heft test --cleaninheft-plugins/heft-lint-plugin: 8 passedheft test --cleaninbuild-tests/eslint-9-test: 1 passed, including a non-TypeScript custom-extension SARIF resultheft build --cleaninlibraries/rush-lib: passed; generateddist/**/*.jsfiles were not lintedheft build --cleaninbuild-tests/localization-plugin-test-02: passed; generateddist-dev/**/*.jsfiles were not lintedheft test --clean --test-name-pattern "returns all files are ignored"inapps/heft: passed after the unrelated full-load timeoutrush change --verifygit diff --check