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

176
Visualizações
Numeric value in front of type/Object's parameter name

I feel so dumb right now, but...

I am facing an issue where I am trying to fetch data from API but the api has JSON object parameters with numeric values in front of them. Something like {1stxxxx: 'value', 2ndxxx: 'value'}

But that gives me error in eslint:

An identifier or keyword cannot immediately follow a numeric literal.

So the type I have is something like this and the eslint doesn't like the number in front of type parameter names and I do not know, and could not find the eslint rule for that case, to turn it off. And that in ReactNative gives the above unavoidable error:

type MyObject = {
  1stXxx?: string;
};

What would be my options? Any help is much appreciated!

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

0

Use quotes, as you would in JavaScript objects:

type MyObject = {
  "1stXxx"?: string;
};
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