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

import autocomplete should provide relative path started with ./ #514

Closed
stepancar opened this issue Aug 3, 2015 · 5 comments
Closed

import autocomplete should provide relative path started with ./ #514

stepancar opened this issue Aug 3, 2015 · 5 comments
Labels

Comments

@stepancar
Copy link
Contributor

Hello, @basarat !
When i write import * as myModule from ''" i have autocomplete wich provide relative path to module - for example '../../MyFolder/myModule'.
i think it should be './../../MyFolder/myModule'
What do you think about it?

@basarat
Copy link
Member

basarat commented Aug 4, 2015

What do you think about it?

Are you seeing a runtime error because of this? Should work fine, don't see the point of adding ./ needlessly ;) 🌹

@stepancar
Copy link
Contributor Author

I haven't any runtime errors . But i see that most webpack loaders uses relative paths which starts with './' maybe you know why?
I catch problem which force me rewrite all relative paths with './' when i used ts-loader for example.
Maybe you know why tsc supports relative paths '../../dir/dir2' and './../../dir/dir2'? Any historical reasons?
Thank you!
I think this issue look like as question ;)

@basarat
Copy link
Member

basarat commented Aug 4, 2015

'./' maybe you know why

Its easy to prefix ./ to all paths to ensure its relative ... e.g. ./foo , ./../foo instead of ./foo, ../foo. Don't see the reason for deleting our code if its doing something better.

Maybe you know why tsc supports relative paths '../../dir/dir2' and './../../dir/dir2'? Any historical reasons?

It just does a path.resolve ... if it work it works.

I think this issue look like as question ;)

🌹

@stepancar
Copy link
Contributor Author

@basarat, Hello!
I created issue for ts-loader which supports only relative paths which started with ./ or ../
results of investigation is that its typescript issue and in the future all relative path's should started with ./ and ../ (see @jbrantly comment) and see typescript relative paths issue
I think that atom typescript should provide autocomplete for import with ./ and ../ now, because without it programmers should rewrite their paths in the future. Imagine how much paths can write programmers which uses you awesome atom-typescript. Last week i rewrote about 200 relative paths))
Thank you!

@basarat
Copy link
Member

basarat commented Aug 14, 2015

I think that atom typescript should provide autocomplete for import with ./ and ../ now, because without it programmers should rewrite their paths in the future.

This is what we already do. We provide relative paths with ./ if the file is located right next to it.

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants