fix: align lint target discovery with files config#1227
Open
fansenze wants to merge 13 commits into
Open
Conversation
ba48bda to
c4cdb50
Compare
949c28e to
7d1b519
Compare
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
This PR makes lint target selection files-driven and removes the old coupling where TypeScript Program membership could decide what gets linted.
files(or rslint's default JS/JSX/TS extensions), explicit CLI/API file/dir inputs, global ignores, and rslint's existing.gitignoreproduct behavior.--type-check.filesas selected 0-rule results, matching ESLint-style behavior, while suppressing syntax diagnostics when no config entry matches.Architecture Changes
programFileIndexso gap detection and target-to-Program binding use the same source-file index, including realpath aliases for symlink/path-canonicalization cases.--fixrelint passes so relinting uses current Program state.FileConfigResolverto cache per-run per-file merged config and enabled rules, including nil misses.lintConfigResolverfor CLI/API multi-config and single-config routing, reused by native lint, syntax diagnostic filtering, and eslint-plugin config resolution..gitignoreparity as a separate follow-up.Behavior Notes
filesmeans the default lintable extension set, not arbitrary files.filesremains rejected by validation; JSON config migration still accepts legacyfiles: []so it can drop unsupported empty fields while generating JS/TS config.filesbut outside tsconfig are linted without type-aware rules..gitignorebehavior is preserved. LSP.gitignoreparity is intentionally not changed in this PR and can be handled separately.Real Repo Performance
Stage-prime results, 10 alternating old/new iterations, median wall time. The new build intentionally lints more files in both repos because missing
filesnow uses the default lintable extension set.