Skip to content

Conversation

@lambda47
Copy link

@lambda47 lambda47 commented Dec 1, 2025

Summary

Add support for files configuration option

  • optimize file matching logic
  • support negation glob patterns in files and ignores configurations

Related Links

Fixed #408

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Dec 1, 2025

👷 Deploy request for rslint pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c3637ae

@CLAassistant
Copy link

CLAassistant commented Dec 1, 2025

CLA assistant check
All committers have signed the CLA.

@lambda47 lambda47 force-pushed the fix/support_files_config branch 2 times, most recently from 5cd9799 to 1b1ad13 Compare December 5, 2025 06:40
- optimize file matching logic
- support negation glob patterns in `files` and `ignores` configurations
@lambda47 lambda47 force-pushed the fix/support_files_config branch from 1b1ad13 to c3637ae Compare January 17, 2026 11:14
@lambda47 lambda47 requested a review from fansenze January 17, 2026 11:31
if isFileIgnored(filePath, entry.Ignores) {
continue // Skip this config entry for ignored files
}
cwd, _ := os.Getwd()
Copy link
Contributor

Choose a reason for hiding this comment

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

If this fails, cwd becomes empty and pattern normalization may behave unexpectedly. Consider referring to the previous logic in isFileIgnoredSimple.

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
Copy link
Contributor

@fansenze fansenze Jan 19, 2026

Choose a reason for hiding this comment

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

The matcher field and GetFileMatcher method on ConfigEntry should be removed. Suggest creating matcher inline in GetRulesForFile instead.

}

// classifyPatterns splits a list of glob patterns into its positive and negative patterns.
func classifyPatterns(patterns []string) (positivePatterns []string, negativePatterns []string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The files configuration is not take effect

3 participants