Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable TSLint Rule: This rule requires the `strictNullChecks` compiler option to be turned on to function correctly

I am in the middle of upgrading our app and I'm getting the following error when i try to build my angular app: This rule requires the strictNullChecks compiler option to be turned on to function correctly @typescript-eslint/no-unnecessary-condition

The problem is that I want "strictNullChecks" to be set to false so that I don't have to refactor the whole application until a later date. Is there a way to turn off this rule? I can't seem to find any documentation on this. I'm getting this same error about 2100 times. Anyone help would be appreciated.

I have tried adding the following to my angularCompilerOptions but that did not resolve my issue: allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: true

like image 710
RiceRiceBaby Avatar asked Oct 24 '25 16:10

RiceRiceBaby


1 Answers

I made next 3 steps to eliminate that error

  1. Added to .eslintrc.js into rules section

"@typescript-eslint/strict-boolean-expressions": "warn"

  1. Added to tsconfig.json into jsoncompilerOptions section

"strictNullChecks": true

  1. Reloaded my IDE

More information about this task

  • at Github in eslint-config-standard-with-typescript repo
  • and at TS ESLint website
like image 166
Kas Elvirov Avatar answered Oct 26 '25 08:10

Kas Elvirov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!