Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds the ability to skip certain files during the linting process by introducing hardcoded skip patterns. The implementation adds support for skipping node_modules directories and bundled TypeScript files across all linter entry points.
- Added hardcoded skip patterns
"/node_modules/"and"bundled:"to exclude common non-source files - Updated all three linter entry points (LSP, CLI, and API) to use the new skip functionality
- Ensures consistent file filtering behavior across different usage modes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmd/rslint/lsp.go | Added skip patterns parameter to LSP linting function call |
| cmd/rslint/cmd.go | Added skip patterns parameter to CLI linting function call |
| cmd/rslint/api.go | Added skip patterns parameter to IPC API linting function call |
| programs, | ||
| false, // Don't use single-threaded mode for LSP | ||
| []string{filename}, | ||
| []string{"/node_modules/", "bundled:"}, |
There was a problem hiding this comment.
Hardcoded skip patterns should be configurable rather than embedded in the code. Consider defining these patterns as constants or making them configurable through the linter configuration.
| []string{"/node_modules/", "bundled:"}, | |
| DefaultSkipPatterns, |
| programs, | ||
| singleThreaded, | ||
| nil, | ||
| []string{"/node_modules/", "bundled:"}, |
There was a problem hiding this comment.
The same hardcoded skip patterns are duplicated across multiple files. This violates DRY principles and makes maintenance difficult. Consider extracting these patterns to a shared constant or configuration.
| []string{"/node_modules/", "bundled:"}, | |
| defaultSkipPatterns, |
| programs, | ||
| false, // Don't use single-threaded mode for IPC | ||
| allowedFiles, | ||
| []string{"/node_modules/", "bundled:"}, |
There was a problem hiding this comment.
This is the third instance of the same hardcoded skip patterns. The duplication makes it error-prone to modify these patterns in the future and violates the DRY principle.
| []string{"/node_modules/", "bundled:"}, | |
| defaultSkipPatterns, |
No description provided.