fix: Support files configuration option#409
Open
lambda47 wants to merge 2 commits intoweb-infra-dev:mainfrom
Open
fix: Support files configuration option#409lambda47 wants to merge 2 commits intoweb-infra-dev:mainfrom
lambda47 wants to merge 2 commits intoweb-infra-dev:mainfrom
Conversation
👷 Deploy request for rslint pending review.Visit the deploys page to approve it
|
5cd9799 to
1b1ad13
Compare
fansenze
reviewed
Jan 16, 2026
fansenze
reviewed
Jan 16, 2026
fansenze
reviewed
Jan 16, 2026
- optimize file matching logic - support negation glob patterns in `files` and `ignores` configurations
1b1ad13 to
c3637ae
Compare
fansenze
reviewed
Jan 19, 2026
| if isFileIgnored(filePath, entry.Ignores) { | ||
| continue // Skip this config entry for ignored files | ||
| } | ||
| cwd, _ := os.Getwd() |
Contributor
There was a problem hiding this comment.
If this fails, cwd becomes empty and pattern normalization may behave unexpectedly. Consider referring to the previous logic in isFileIgnoredSimple.
fansenze
reviewed
Jan 19, 2026
| LanguageOptions *LanguageOptions `json:"languageOptions,omitempty"` | ||
| Rules Rules `json:"rules"` | ||
| Plugins []string `json:"plugins,omitempty"` // List of plugin names | ||
| matcher *fileMatcher // Cache for the file matcher |
Contributor
There was a problem hiding this comment.
The matcher field and GetFileMatcher method on ConfigEntry should be removed. Suggest creating matcher inline in GetRulesForFile instead.
fansenze
reviewed
Jan 19, 2026
| } | ||
|
|
||
| // classifyPatterns splits a list of glob patterns into its positive and negative patterns. | ||
| func classifyPatterns(patterns []string) (positivePatterns []string, negativePatterns []string) { |
Contributor
There was a problem hiding this comment.
This separates patterns into two groups, which differs from how ignores handles negation (sequential "last match wins"). For example, ["src/**", "!**/*.test.ts", "**/important.test.ts"] would exclude important.test.ts because all negative patterns are applied after all positive patterns.
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
Add support for
filesconfiguration optionfilesandignoresconfigurationsRelated Links
Fixed #408
Checklist