You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compilation fails with errors about ignored library k8s:
node_modules/k8s/index.ts(5,23): error TS7006: Parameter 'conf' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(8,13): error TS7005: Variable 'Buffer' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(12,5): error TS7008: Member 'strictSSL' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(13,5): error TS7008: Member 'domain' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(14,5): error TS7008: Member 'auth' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(42,25): error TS7006: Parameter 'kubeconfig' implicitly has an 'any' type.
... etc
In the meantime, you could run a post-install step to produce the .d.ts files into a local ./src/types/k8s/, and use path mapping to resolve imports to "k8s" to those local .d.ts file.
So this could be your root tsconfig.json which is adjacent to your src:
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
I understand that libraries shouldn't publish *.ts files, but sometimes, they just do, and we can't control every other library easily.
I think typescript should not try to apply this kind of setting (here noImplicitAny) to the node_modules simply because it is meant to be applied to the user code being compiled, not the external dependencies.
Reacted by Andrej K, Andy Ma and Steve Brush
Reacted by John Walker, Wil Marques, Eugene Shalyuk, Anatoly Ostapenko and Tobias Brenner
Activity
DanielRosenwasser commentedon Apr 25, 2017
Sounds like k8s shouldn't be distributing
.tsfiles - it should be distributing just the.jsand.d.tsfiles instead.sciolizer commentedon Apr 25, 2017
I thought that might be the case. I can request a fix, but is there anything I can do about it in the meantime?
DanielRosenwasser commentedon Apr 25, 2017
I opened up Goyoo/node-k8s-client#35 for you.
In the meantime, you could run a post-install step to produce the
.d.tsfiles into a local./src/types/k8s/, and use path mapping to resolve imports to"k8s"to those local.d.tsfile.So this could be your root
tsconfig.jsonwhich is adjacent to yoursrc:{ "compilerOptions": { "noImplicitAny": true, // ... "baseUrl": "./", "paths": { "*": ["src/types/k8s"] } } }And you could make a separate
tsconfig.k8s.jsonwhich looks something like{ "compilerOptions": { "declaration": true, "declarationDir": "./src/types/k8s" }, "include": ["./node_modules/k8s/index.ts"] }sciolizer commentedon Apr 25, 2017
The workaround works great, thanks!
mhegazy commentedon May 19, 2017
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
victornoel commentedon Jun 19, 2017
Daniel Rosenwasser (@DanielRosenwasser) Mohamed Hegazy (@mhegazy) I'm not sure we should consider this fixed.
I understand that libraries shouldn't publish
*.tsfiles, but sometimes, they just do, and we can't control every other library easily.I think typescript should not try to apply this kind of setting (here
noImplicitAny) to thenode_modulessimply because it is meant to be applied to the user code being compiled, not the external dependencies.