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

137
Visualizações
es lint max length rule disabling is not working

I am trying to disable eslint rule in a typescript file. I have a regular expression which contains more than 500 characters. So it's generated an eslint warning. Since this is a regular expression, better way is to add an eslint comment before declaring the regular expression only for that line. So my attempt is as below.

/* eslint-disable-next-line max-len */
export const URI_REGEX = "" // something which is very long

But still this is not working. I could see the eslint warning as This line has a length of 509. Maximum allowed is 270. So how can I remove this warning?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Which version of eslint do you have? I think you can can try //eslint-disable-line for disable all rules for the specific line, or using // eslint-disable max-len

Taking from here: https://github.com/prettier/prettier/issues/3375

Edit

I think you can also add a ignoreRule for you speisifc regex. See here the docs: https://eslint.org/docs/rules/max-len of ignorePattern

about 4 years ago · Juan Pablo Isaza Relatório

0

Not sure, your method should be working but can you give this a try by wrapping it?

/* eslint-disable max-len */ 
   export const URI_REGEX = "" // something which is very long
/* eslint-enable max-len */
about 4 years ago · Juan Pablo Isaza 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