Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

621
Views
@angular-eslint/template/eqeqeq Disable or allow null

Using Angular 12 & eslint, I've got an error in the template because I'm doing this:

<button [disabled]="someVariable == null"></button>

Expected === but received == eslint(@angular-eslint/template/eqeqeq)

When going through the source code, I noticed an option called allowNullOrUndefined.

I tried to define the rule like this:

"@angular-eslint/template/eqeqeq": [
    "error",
    {
        "allowNullOrUndefined": true
    }
]

But I still got the error. So I tried to completely disabled the rule, like this:

"@angular-eslint/template/eqeqeq": ["off"]

or like this:

"@angular-eslint/template/eqeqeq": "off"

But with no luck, I still get the error in the template.

I couldn't find any documentation regarding that rule. Can I disable it or allow double equal for null or undefined ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

2 years later! You were close. Add this to the HTML section of .eslintrc.json like so:

{
  "files": [
    "*.html"
  ],
  "extends": [
    "plugin:@angular-eslint/template/recommended"
  ],
  "rules": {
    "@angular-eslint/template/eqeqeq": [
      "error",
      {
        "allowNullOrUndefined": true
      }
    ]
  }
}

Obviously make sure you have the right npm modules installed such as @angular-eslint/template-parser

These should already be installed if you used ng add @angular-eslint/schematics --skip-confirmation to install eslint into your Angular project.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!