Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

625
Visualizações
@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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda