-
Notifications
You must be signed in to change notification settings - Fork 0
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
✨ Add option to allow relative imports #3
Conversation
}, | ||
}) | ||
|
||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should generally try to remove all methods that act on strings when dealing with paths here and try to find safer versions - dealing with paths is very tricky and using string methods always has corner cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only 3 places left where I use "replace".
All of which are removing prefixes from a path.
There is path.relative
, but that has applications outside of simply removing a prefix, which I do not want to allow to happen, so I think sticking with replace
in these cases instead is the right call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - if what we are doing is building a relative path, I think we should do that. What corner cases do you see exactly?
📦 Published PR as canary version:
0.3.0--canary.3.1498669480.0
✨ Test out this PR locally via:
npm install @opencreek/eslint-plugin-ts@0.3.0--canary.3.1498669480.0 # or yarn add @opencreek/eslint-plugin-ts@0.3.0--canary.3.1498669480.0