Skip to content

fix(cli): fix tsgolint path resolution for yarn install#360

Merged
Brooooooklyn merged 1 commit into
mainfrom
12-23-fix_cli_fallback_to_cwd_s_node_modules_to_find_tsgolint
Dec 23, 2025
Merged

fix(cli): fix tsgolint path resolution for yarn install#360
Brooooooklyn merged 1 commit into
mainfrom
12-23-fix_cli_fallback_to_cwd_s_node_modules_to_find_tsgolint

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Dec 23, 2025

What changed?

  • Added existsSync import from node:fs to check if files exist
  • Modified the tsgolint binary resolution logic to:
    • First try to resolve from oxlint-tsgolint/bin/tsgolint for non-Windows platforms
    • For Windows, attempt to find the binary in the local node_modules/.bin directory
    • Add a fallback to the current working directory's node_modules/.bin if not found
  • Simplified the environment variable assignment by moving the platform-specific logic to the path resolution
yarn lint

Failed to find tsgolint executable: OXLINT_TSGOLINT_PATH points to 
'~/rollipop/node_modules/@voidzero-dev/vite-plus/node_modules/.bin/tsgolint' 
which does not exist

Copy link
Copy Markdown
Member Author

fengmk2 commented Dec 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 changed the title fix(cli): fallback to cwd's node_modules to find tsgolint fix(cli): improve tsgolint path resolution for Windows Dec 23, 2025
@fengmk2 fengmk2 changed the title fix(cli): improve tsgolint path resolution for Windows fix(cli): improve tsgolint path resolution for yarn install Dec 23, 2025
@fengmk2 fengmk2 changed the title fix(cli): improve tsgolint path resolution for yarn install fix(cli): fix tsgolint path resolution for yarn install Dec 23, 2025
@fengmk2 fengmk2 marked this pull request as ready for review December 23, 2025 01:56
Copilot AI review requested due to automatic review settings December 23, 2025 01:56
@fengmk2 fengmk2 self-assigned this Dec 23, 2025
Comment thread packages/cli/src/resolve-lint.ts Outdated
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 addresses tsgolint binary path resolution issues with yarn installations by adding platform-specific logic and existence checks. The changes aim to fix a bug where the tsgolint executable path was incorrectly resolved, particularly on Windows systems.

Key Changes:

  • Added existsSync import for file validation
  • Implemented platform-specific path resolution for Windows (using .cmd extension and local node_modules/.bin)
  • Added fallback logic to search in current working directory's node_modules/.bin on Windows
  • Simplified environment variable assignment by moving platform-specific logic into path resolution

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

Comment thread packages/cli/src/resolve-lint.ts
Comment thread packages/cli/src/resolve-lint.ts
Comment thread packages/cli/src/resolve-lint.ts
Comment thread packages/cli/src/resolve-lint.ts Outdated
@fengmk2 fengmk2 force-pushed the 12-23-fix_cli_fallback_to_cwd_s_node_modules_to_find_tsgolint branch from d7e2b92 to 2a8aef1 Compare December 23, 2025 02:01
Copilot AI review requested due to automatic review settings December 23, 2025 02:13
@fengmk2 fengmk2 force-pushed the 12-23-fix_cli_fallback_to_cwd_s_node_modules_to_find_tsgolint branch from 2a8aef1 to 8100086 Compare December 23, 2025 02:13
Copy link
Copy Markdown
Member Author

fengmk2 commented Dec 23, 2025

Merge activity

  • Dec 23, 2:14 AM UTC: Graphite rebased this pull request as part of a merge.
  • Dec 23, 2:25 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 23, 2:26 AM UTC: @Brooooooklyn merged this pull request with Graphite.
  • Dec 23, 2:26 AM UTC: Graphite couldn't merge this PR because it was not satisfying all requirements.

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


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

Comment thread packages/cli/src/resolve-lint.ts
@Brooooooklyn Brooooooklyn merged commit d84f9c1 into main Dec 23, 2025
18 checks passed
@Brooooooklyn Brooooooklyn deleted the 12-23-fix_cli_fallback_to_cwd_s_node_modules_to_find_tsgolint branch December 23, 2025 02:26
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