Skip to content

feat: support glob patterns for project config#493

Merged
fansenze merged 2 commits intomainfrom
kdy1/finish-pr-439-project-globs
Mar 6, 2026
Merged

feat: support glob patterns for project config#493
fansenze merged 2 commits intomainfrom
kdy1/finish-pr-439-project-globs

Conversation

@kdy1
Copy link
Copy Markdown
Collaborator

@kdy1 kdy1 commented Mar 6, 2026

Supersedes #439 with the remaining maintainer feedback applied on top of current main.

What changed:

  • add glob expansion for languageOptions.parserOptions.project
  • preserve project entry order while deduplicating expanded matches
  • expand globs through the configured VFS so API/LSP overlay filesystems keep working
  • add focused config tests for glob expansion, **, no-match, dedupe, and overlay VFS cases
  • update rslint.json to use package glob patterns and ignore typescript-go/**

Maintainer feedback addressed:

  • rebased onto current main
  • kept // @ts-nocheck in packages/rslint-wasm/src/worker.ts
  • restored the CI ignore for typescript-go/**

Verification:

  • GOCACHE=/tmp/rslint-go-build go test ./internal/config -run 'Test(ContainsGlobPattern|LoadTsConfigsFromRslintConfig)'
  • git diff --check -- internal/config/loader.go internal/config/loader_test.go rslint.json

Copilot AI review requested due to automatic review settings March 6, 2026 07:46
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the configuration flexibility for TypeScript projects by introducing glob pattern support in rslint.json. This change allows for automatic discovery and inclusion of tsconfig.json files across various directories, simplifying project setup and maintenance. It also ensures robust handling of paths, including deduplication and compatibility with virtual file systems, making the configuration process more dynamic and less error-prone.

Highlights

  • Glob Pattern Support: Implemented support for glob patterns within languageOptions.parserOptions.project configurations, allowing for more flexible and dynamic discovery of TypeScript project files.
  • Path Deduplication and Order Preservation: Ensured that expanded glob matches are deduplicated while preserving their original entry order, preventing redundant configurations.
  • Virtual File System (VFS) Integration: Integrated glob expansion with the configured VFS, ensuring compatibility with API/LSP overlay filesystems.
  • Comprehensive Testing: Added a new test file with focused configuration tests covering glob expansion, ** patterns, no-match scenarios, deduplication, and overlay VFS cases.
  • Rslint Configuration Update: Updated rslint.json to utilize the new glob pattern capabilities for project paths and re-added typescript-go/** to the ignore list.
Changelog
  • internal/config/loader.go
    • Added sort and strings packages for path manipulation and sorting.
    • Imported github.com/bmatcuk/doublestar/v4 for glob pattern matching.
    • Modified LoadTsConfigsFromRslintConfig to detect and expand glob patterns in project paths.
    • Introduced appendUniqueConfigPath to add paths to a slice only if they haven't been seen before, ensuring deduplication.
    • Added expandProjectGlob function to resolve glob patterns into concrete file paths using the VFS.
    • Implemented containsGlobPattern to quickly check if a string contains glob characters.
    • Developed walkProjectFiles to recursively traverse the file system using the VFS, respecting visited directories.
    • Created globSearchRoot to determine the effective root directory for a given glob pattern, optimizing file system walks.
    • Added normalizeGlobPath to standardize path separators for consistent glob matching.
  • internal/config/loader_test.go
    • Added a new test file to validate the new glob pattern functionality.
    • Included TestContainsGlobPattern to verify glob character detection.
    • Provided TestLoadTsConfigsFromRslintConfig_GlobExpansion to confirm basic glob pattern resolution.
    • Added TestLoadTsConfigsFromRslintConfig_NoMatches to test error handling when a glob pattern yields no results.
    • Implemented TestLoadTsConfigsFromRslintConfig_MixedGlobAndNonGlob to ensure both types of paths are handled correctly.
    • Created TestLoadTsConfigsFromRslintConfig_DeduplicatesMatches to verify that duplicate paths are correctly removed.
    • Included TestLoadTsConfigsFromRslintConfig_GlobExpansionWithOverlayVFS to confirm VFS integration for glob expansion.
    • Added TestLoadTsConfigsFromRslintConfig_NonExistentNonGlobFile to test error handling for missing non-glob files.
    • Provided TestLoadTsConfigsFromRslintConfig_DoubleStarPattern to validate recursive glob matching.
    • Added createTestFile helper function for setting up test environments.
  • rslint.json
    • Updated the ignore list to include typescript-go/**.
    • Modified the project array under languageOptions.parserOptions to use glob patterns (./packages/*/tsconfig.build.json, ./packages/*/tsconfig.spec.json) instead of explicit paths for tsconfig.build.json and tsconfig.spec.json.
Activity
  • This pull request supersedes a previous iteration (feat: add glob pattern support for project configuration #439), incorporating maintainer feedback.
  • The branch was rebased onto the current main branch to ensure it's up-to-date.
  • Specific feedback regarding // @ts-nocheck in packages/rslint-wasm/src/worker.ts was addressed by retaining the comment.
  • The CI ignore for typescript-go/** was restored as per maintainer feedback.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Adds documented glob-pattern support for languageOptions.parserOptions.project so monorepo TypeScript config discovery can be maintained via patterns (including **) while working correctly with the configured VFS/overlay filesystem (e.g., LSP scenarios).

Changes:

  • Expand glob patterns in parserOptions.project, preserving user-specified entry order while deduplicating expanded paths.
  • Implement VFS-backed glob expansion via directory walking + doublestar matching (supports overlay VFS).
  • Add focused tests covering glob expansion, **, no-match errors, dedupe behavior, and overlay VFS behavior; update repo rslint.json to use globs and ignore typescript-go/**.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/config/loader.go Adds glob detection/expansion and stable deduped path collection using the configured VFS.
internal/config/loader_test.go Adds unit tests for glob expansion behavior and overlay VFS correctness.
rslint.json Switches project configuration to glob patterns and restores typescript-go/** ignore.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@fansenze
Copy link
Copy Markdown
Contributor

fansenze commented Mar 6, 2026

@kdy1 Hey! I took a look at the CI failure — here's what's going on:

The glob patterns ./packages/*/tsconfig.build.json and ./packages/*/tsconfig.spec.json now pick up packages/rslint-wasm/tsconfig.build.json, which wasn't included before when the tsconfigs were listed explicitly. This brings packages/rslint-wasm/src/worker.ts into the linting scope, and that file starts with // @ts-nocheck, which triggers the lint error:

Do not use '@ts-nocheck' because it alters compilation errors.

A simple fix would be to add packages/rslint-wasm/src/worker.ts to the ignores array in rslint.json. That should get CI green again!

@kdy1
Copy link
Copy Markdown
Collaborator Author

kdy1 commented Mar 6, 2026

@fansenze Thank you so much for the guidance! I did it :)

@fansenze fansenze enabled auto-merge (squash) March 6, 2026 13:42
@fansenze fansenze merged commit c6bb100 into main Mar 6, 2026
22 of 24 checks passed
@fansenze fansenze deleted the kdy1/finish-pr-439-project-globs branch March 6, 2026 13:43
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.

3 participants