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

Single Forward Slashes Being Converted to Double Backslash #25

Open
spreadred opened this issue Jul 29, 2022 · 1 comment
Open

Single Forward Slashes Being Converted to Double Backslash #25

spreadred opened this issue Jul 29, 2022 · 1 comment

Comments

@spreadred
Copy link

spreadred commented Jul 29, 2022

OS: Windows
Terminal: git-bash
NodeJS: v16.15.1
relative-to-alias: 2.0.1

When running:
relative-to-alias --src ./ --alias @shared --alias-path ./shared
This original require: require('../../shared/mappers/AddressSqlRecordMapper');
is transformed to require('@shared\\mappers\\AddressSqlRecordMapper');

This transformed require is not valid.

@KagamiChan
Copy link

KagamiChan commented Apr 29, 2024

The package is using Node.js path module to process the updated paths, and on Windows the system separator is \, thus producing double backslash

this could be fixed by simply switching path module to path/posix, I've verified with my local modification

@s-yadav do you think if I should send out a PR on this? changing the imports is easy but apparently I have to also update ESLint import plugin so that the new module could be recognized as Nodejs internals and that would take more time.

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

No branches or pull requests

2 participants