Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

623
Vistas
@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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda