Closed stephane-tessier closed 1 year ago
Thanks for reporting that @stephane-tessier.
Could you please confirm that you don't have any issues with type checking on your editor nor when using CLI commands (ng serve...)?
Yes, I can confirm that. Everything works fine except the tsc
cli
The only way I see to make it work with tsc is to update the tsconfig files generated by the CLI, something like types: []
in tsconfig.json
but not sure if that's the best/ a viable solution.
Not sure what you mean.
In my package.json I have:
"@types/jasmine": "3.10.2",
"@types/luxon": "2.0.7",
"@types/node": "16.11.10",
So in tsconfig.json I tried to force jasmin and luxon:
"types": ["luxon", "jasmine"],
but it didn't solve the problem.
BUT if I declare the types directly in the cli args, it seems to do the trick :partying_face:
tsc --noEmit --types jasmine,luxon && eslint . --ext js,ts --fix
It will do for now. But if you have a cleaner solution let me know! Thanks.
the only error I found is when I run ng run my-project:server
because there is types: [ 'node']
in the tsconfig.server.json file so it conflicts the exact same way.
I solved it by adding "skipLibCheck": true,
in the compilerOptions of the tsconfig.server.json file.
Also, I think tsc --noEmit --skipLibCheck && eslint . --ext js,ts --quiet --fix
is better than specifying the types
Hi
I'd like to reopen https://github.com/chihab/ngx-env/issues/8
I have the same problem but I didn't understand the fix.
I have
src/env.d.ts
:and when I run my linter:
"Cannot redeclare block-scoped variable 'process'."