angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Generated main.ts showing errors in intelliJ

Open zackarychapple opened this issue 10 years ago • 9 comments

The generated main.ts shows errors when using beta.0 The imports for AppComponent and environment both had issues in IntelliJ on OSX.

Non working: import { AppComponent, environment } from './app/'; Working: import { AppComponent, environment } from './app';

zackarychapple avatar May 07 '16 04:05 zackarychapple

I tested in Atom and Visual Studio Code and they seemed to be ok with import { AppComponent, environment } from './app/';

filipesilva avatar May 07 '16 04:05 filipesilva

Same in webstorm. I had to remove trailing slash.

hawlik avatar May 07 '16 07:05 hawlik

I just reopen webstorm and error from IDE gone

Codenator81 avatar May 08 '16 09:05 Codenator81

Considering WebStorm is IntelliJ with a different theming, it's not surprising. I think we should fix this.

hansl avatar May 09 '16 18:05 hansl

Not sure we can fix it, perhaps by changing something in tsconfig.json?

Removing the slash isn't the solution since we can have the app.ts file and the app/ folder, which would both be resolved to the same using import {} from './app'.

filipesilva avatar May 09 '16 19:05 filipesilva

To be clear though, the slash should be there, the issue is with webstorm recognizing barrels.

filipesilva avatar May 09 '16 19:05 filipesilva

I talked to JetBrains, and they seem to be moving towards using the TypeScript compiler which will probably resolve this. In any case I agree with Filipe.

hansl avatar May 09 '16 20:05 hansl

There appears to be a consensus that this does not need fixed and we will be relying on JetBrains to resolve the issue in IntelliJ & WebStorm; therefore, closing this issue.

Brocco avatar May 11 '16 14:05 Brocco

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.