I am using TSLint with "no-any": true, "no-unsafe-any": true
. It disallow:
let foo: any;
However it still allows:
let foo;
How to turn on the rule for implicit any?
I am using TSLint with "no-any": true, "no-unsafe-any": true
. It disallow:
let foo: any;
However it still allows:
let foo;
How to turn on the rule for implicit any?
As of now there is no option in tslint to achieve that.
You could use the typescript compiler option "noImplicitAny": true
, which can be configured using tsconfig.json
.
Reference : https://www.typescriptlang.org/docs/handbook/compiler-options.html
© 2022 - 2024 — McMap. All rights reserved.
foo
in you second example is notany
butundefined
. If you use it it will get another type (ts tests the control flow). – Jaime