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

339
Vistas
Typescript: Disabling es-lint rule for only an interface?

I have the rule in my project to disallow variables not in camelcase. I am hitting an external API where the response comes back with an object that has variables in camelcase. When I define a type:

interface AgeData {
    name: string,
    corner: number
}

interface APIResp {
    file_name: string,
    data_info: AgeData[],
    interest_m: number
}

I need to use camelcase for the expected format back from the API since I can't control the external API.
Throughout the rest of my code, I use:

// eslint-disable-next-line camelcase

to disable it but this doesn't seem to work for interfaces.
I don't want to change the rule or override it. It's a fairly large project and I just want it this one interface.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't think camelcase can be as type-aware as you're hoping for, but what it can do is:

  • Permit property names to have underscores (or forbid property names to have underscores). This is separate from permitting standalone identifiers from having underscores. Or
  • Permit specific whitelisted property names even if they don't match the pattern.

So, one way is to use the following config for the ESLint rule:

[
  'error',
  {
    allow: ['file_name', 'data_info', 'interest_m']
  }
]
about 4 years ago · Juan Pablo Isaza 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