Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@typescript-eslint/strict-boolean-expressions lint rule

adding

"@typescript-eslint/strict-boolean-expressions": [
    2,
    {
        "ignoreRhs": true,
        "allow-boolean-or-undefined": true
    }
],

to my eslintrc.json gives me the following error Error: .eslintrc.json: Configuration for rule "@typescript-eslint/strict-boolean-expressions" is invalid: Value {"ignoreRhs":true,"allow-boolean-or-undefined":true} should NOT have additional properties.

What is the right way to mention options for this rule?

like image 373
kranthi Avatar asked Oct 29 '25 08:10

kranthi


2 Answers

On eslintrc rules you can try the configuration below and eslint will stop notifying you.

  "rules": {
    "@typescript-eslint/strict-boolean-expressions": 0
  }

like image 191
Washington Souza Avatar answered Oct 31 '25 11:10

Washington Souza


The allow-boolean-or-undefined doesn't exist for this rule on ESLint, the option equivalent is the allowNullable. The correct syntax is:

'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullable: true, ignoreRhs: true }],

You can check the doc for the rule strict-boolean-expressions documentation

like image 32
Ana Avatar answered Oct 31 '25 11:10

Ana



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!