Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): Normalize paths when in getSourceFilePath #18601

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

jogelin
Copy link
Contributor

@jogelin jogelin commented Aug 12, 2023

Current Behavior

When running the linting rule @nx/dependency-checks for a project on a Windows machine, it doesn't fail even if the list of packages is not valid.

The projectPath provided to the utility function getSourceFilePath in packages/eslint-plugin/src/utils/runtime-lint-utils.ts is not normalized:

image

Expected Behavior

The linting rule @nx/dependency-checks should work in the same way on Windows or UNIX paths.

Fixes

To prevent future issues, I decided to make the getSourceFilePath compatible with any type of path instead of fixing the @nx/dependency-checks code.

Tests are covering that utility function @nx/dependency-checks

@jogelin jogelin requested a review from a team as a code owner August 12, 2023 13:03
@jogelin jogelin requested a review from meeroslav August 12, 2023 13:03
@vercel
Copy link

vercel bot commented Aug 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2023 1:09pm

Copy link
Contributor

@meeroslav meeroslav left a comment

Choose a reason for hiding this comment

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

LGTM!

@meeroslav meeroslav self-assigned this Aug 17, 2023
@meeroslav meeroslav merged commit 1f9b3c4 into nrwl:master Aug 17, 2023
2 checks passed
FrozenPandaz pushed a commit that referenced this pull request Aug 18, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants