Skip to content

Conversation

@GoodbyeNJN
Copy link

@GoodbyeNJN GoodbyeNJN commented Apr 21, 2025

  • Run tests
  • Update the CHANGELOG.md with a summary of your changes

@GoodbyeNJN GoodbyeNJN marked this pull request as ready for review April 21, 2025 08:24
@auto-assign auto-assign bot requested a review from ntotten April 21, 2025 08:24
@ntotten ntotten requested a review from Copilot November 27, 2025 14:10
Copilot finished reviewing on behalf of ntotten November 27, 2025 14:12
Copy link
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 extends tilde (~) path resolution support from macOS-only to all Unix-like systems and Windows. Previously, the code only resolved paths starting with ~ on Darwin (macOS), but now it works universally across platforms.

  • Removed platform-specific check for darwin to enable tilde expansion on all platforms
  • Updated comment to reflect support for both Unix and Windows path separators

Reviewed changes

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

File Description
src/util.ts Removed macOS-specific platform check to enable tilde path resolution on Unix and Windows
CHANGELOG.md Added entry documenting the new cross-platform tilde path resolution feature

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

pathToResolve.indexOf("~") === 0 &&
os.homedir()
) {
// In case the user wants to use path like `~/.prettierrc` on unix or `~\.prettierrc` on windows
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The word 'unix' should be capitalized as 'Unix' to match the capitalization of 'Windows' in the same sentence.

Suggested change
// In case the user wants to use path like `~/.prettierrc` on unix or `~\.prettierrc` on windows
// In case the user wants to use path like `~/.prettierrc` on Unix or `~\.prettierrc` on windows

Copilot uses AI. Check for mistakes.
Comment on lines +11 to 13
// In case the user wants to use path like `~/.prettierrc` on unix or `~\.prettierrc` on windows
if (pathToResolve.indexOf("~") === 0 && os.homedir()) {
return pathToResolve.replace(/^~(?=$|\/|\\)/, os.homedir());
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The tilde path resolution logic now supports Windows in addition to Unix systems, but lacks test coverage. Consider adding unit tests to verify: (1) tilde expansion works with Unix-style paths (~/.prettierrc), (2) tilde expansion works with Windows-style paths (~\.prettierrc), (3) tilde is not expanded when it appears mid-path, and (4) behavior when os.homedir() is empty.

Copilot uses AI. Check for mistakes.
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.

2 participants