Skip to content

Conversation

@Rettend
Copy link

@Rettend Rettend commented Dec 23, 2025

I use Windows, and I just cloned the repo, install, ran the test script, and it failed.

So I fixed some hardcoded forward slashes by using node:path.

Now every test passes locally

Copilot AI review requested due to automatic review settings December 23, 2025 22:27
@vercel
Copy link

vercel bot commented Dec 23, 2025

@Rettend is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

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 fixes Windows path compatibility issues in the no-relative-imports ESLint plugin by replacing hardcoded forward slashes with proper Node.js path methods.

Key Changes

  • Introduced a normalize() function to ensure consistent cross-platform path representation using forward slashes internally
  • Refactored findTsConfigDirectory() to use path.dirname() instead of string splitting on forward slashes
  • Applied normalization to path comparisons throughout the PathEntry class

Reviewed changes

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

File Description
packages/no-relative-imports/src/paths.ts Added normalize() helper function and applied it to path comparisons in PathEntry class to ensure consistent forward-slash representation across platforms
packages/no-relative-imports/src/noRelativeImportPaths.ts Refactored findTsConfigDirectory() to use path.resolve() and path.dirname() instead of string manipulation, eliminating hardcoded forward slash assumptions

const configStat = statSync(configPath);
if (configStat.isFile()) break;
if (configStat.isFile()) return current;
} catch (_) {
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

'_' is defined but never used.

Suggested change
} catch (_) {
} catch {

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

1 participant