@phpstorm my IDE warns me about "Import can be shortened" (in ts). Shortened path would be the alias from the tsconfig.json; but this leads to circular dependencies on compile. Is there a way to only shorten paths not within the same package?
-
-
Replying to @nehalist
can you please try to set the option in Preferences | Editor | Code Style | TypeScript - Imports to Only for files outside specified paths or if it doesn't help, to Never.
1 reply 0 retweets 0 likes -
Replying to @phpstorm
Thanks for your reply. Sadly neither of the options you've mentioned solved my problem :/
1 reply 0 retweets 0 likes -
In this case, it would be really great if you could share an example with us.1 reply 0 retweets 0 likes -
Replying to @WebStormIDE @phpstorm
See https://github.com/nehalist/ide-import-path …; the foo.service.ts in the library either causes a warning or a circular dependency, depending on how the BarService is imported.
1 reply 0 retweets 0 likes -
Can you please try to reopen the file after you've changed the option to Never. However, it will disable custom paths for all automatically added imports.
1 reply 0 retweets 0 likes -
Alternatively, you can disable the inspection for that specific import: put a cursor in the import path, press Alt-Enter, then arrow Right and select Suppress for Statement.
1 reply 0 retweets 0 likes
We will also work on a new inspection that will check for the cyclic imports. Stay tuned!
-
-
And an additional check for cyclic imports when doing auto import. The fix will land most probably in WebStorm 2019.2.1 or 2019.2.2.
1 reply 0 retweets 1 like -
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.