Goyoo / node-k8s-client

kubernetes client of node.js
MIT License
164 stars 59 forks source link

tslint issues #45

Open ManeeshSharma17 opened 6 years ago

ManeeshSharma17 commented 6 years ago

I am trying to use this library to interact with kubernetes. I am having difficulties with typescript complier.

Error

$ tsc -p tsconfig.json
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.
node_modules/k8s/lib/request.ts(45,41): error TS7006: Parameter 'x' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(49,25): error TS7006: Parameter 'kubeconfig' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(49,37): error TS7006: Parameter 'context' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(52,41): error TS7006: Parameter 'x' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(56,22): error TS7006: Parameter 'kubeconfig' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(56,34): error TS7006: Parameter 'context' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(59,38): error TS7006: Parameter 'x' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(63,24): error TS7006: Parameter 'cluster' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(77,27): error TS7006: Parameter 'user' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(91,28): error TS7006: Parameter 'user' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(105,27): error TS7006: Parameter 'user' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(112,26): error TS7006: Parameter 'user' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(118,26): error TS7006: Parameter 'user' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(124,26): error TS7006: Parameter 'cluster' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(130,30): error TS7006: Parameter 'primise' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(130,39): error TS7006: Parameter 'callback' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(134,26): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(136,22): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(173,35): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(177,63): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(177,68): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(177,73): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(192,35): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(196,63): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(196,68): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(196,73): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(210,14): error TS7006: Parameter 'url' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(210,19): error TS7006: Parameter 'body' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(210,25): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(214,78): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(214,83): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(214,88): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(228,13): error TS7006: Parameter 'url' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(228,18): error TS7006: Parameter 'body' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(228,24): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(232,77): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(232,82): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(232,87): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(246,15): error TS7006: Parameter 'url' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(246,20): error TS7006: Parameter 'body' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(246,26): error TS7006: Parameter '_options' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(246,37): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(266,45): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(266,50): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(266,55): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(280,16): error TS7006: Parameter 'url' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(280,21): error TS7006: Parameter 'json' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(280,28): error TS7006: Parameter 'done' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(289,69): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(289,74): error TS7006: Parameter 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(289,79): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(303,15): error TS7006: Parameter 'url' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(303,20): error TS7006: Parameter 'message' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(303,30): error TS7006: Parameter 'exit' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(303,37): error TS7006: Parameter 'timeout' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(309,13): error TS7034: Variable 'res' implicitly has type 'any' in some locations where its type cannot be determined.
node_modules/k8s/lib/request.ts(311,46): error TS7006: Parameter 'observer' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(314,90): error TS7006: Parameter 'e' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(314,117): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(316,21): error TS7005: Variable 'res' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(337,37): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(346,30): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/k8s/lib/request.ts(348,16): error TS7006: Parameter 'err' implicitly has an 'any' type.

tsconfig.json

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "outDir": "dist",
    "sourceMap": true,
    "noEmitOnError": true,
    "noImplicitAny": true
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
    // "./node_modules/**/*"  // Not working either
    // "**/node_modules/*"    // Not working 
  ]
}

Can someone help me on this.

ixrock commented 6 years ago

I guess this happens cause you have "noImplicitAny": true in your config. Set it to false to avoid all these checks from compiler.

This lib seems to be was roughly converted from js to ts without much caring about types in source code.