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?
You can stop this behavior by enabling the compiler flag noImplicitAny . To enable open the tsconfig file and add the "noImplicitAny":true under the compilerOptions .
The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file instead, which acts almost the same but has some JavaScript-related compiler flags enabled by default.
allowJs is the option newly available in 1.8. The TypeScript compiler will run a quick sanity check on . js files for syntax errors but otherwise passes them straight through to the output directory.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With