Skip to content

feat: add skip files to linter#236

Merged
hardfist merged 4 commits intomainfrom
feat/add-skip-files-to-linter
Aug 12, 2025
Merged

feat: add skip files to linter#236
hardfist merged 4 commits intomainfrom
feat/add-skip-files-to-linter

Conversation

@zoolsher
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 12, 2025 07:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Comment thread cmd/rslint/lsp.go Outdated
programs,
false, // Don't use single-threaded mode for LSP
[]string{filename},
[]string{"/node_modules/", "bundled:"},
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
[]string{"/node_modules/", "bundled:"},
DefaultSkipPatterns,

Copilot uses AI. Check for mistakes.
Comment thread cmd/rslint/cmd.go Outdated
programs,
singleThreaded,
nil,
[]string{"/node_modules/", "bundled:"},
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
[]string{"/node_modules/", "bundled:"},
defaultSkipPatterns,

Copilot uses AI. Check for mistakes.
Comment thread cmd/rslint/api.go Outdated
programs,
false, // Don't use single-threaded mode for IPC
allowedFiles,
[]string{"/node_modules/", "bundled:"},
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
[]string{"/node_modules/", "bundled:"},
defaultSkipPatterns,

Copilot uses AI. Check for mistakes.
@hardfist hardfist merged commit 509cbb7 into main Aug 12, 2025
4 checks passed
@hardfist hardfist deleted the feat/add-skip-files-to-linter branch August 12, 2025 08:19
ScriptedAlchemy pushed a commit that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants