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

136
Vistas
TypeScript configuration

I'm new to the world of typeScript, hence I'm having some configuration issues. The problem is that some methods are not working even though they theoretically should. Currently my typeScript config looks as follows:

    {
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
    "noEmitOnError": true,
    "strictNullChecks": true,
    "lib": [
      "dom",
      "ES2015.Collection",
      "ES2015.Iterable",
      "ES2016.Array.include",
      "ES2017.Object",
      "ES5",
      "ES6",
    ],
  }
}

Everything seems to be fine besides the fact that when I try to use for example Number.isInteger() method or Array.entries() method following error occurs:

Property 'isInteger' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.

The same happens with .entries(). Can anyone help?

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

0

The following is from the Typescript playground. If you follow the link and toggle the options, you can figure out what you need. Looks like you need more of ES2015, they show as errors when target is ES5.

console.log(Number.isInteger(1))
const arr = [1, 2, 3]
console.log(arr.entries())

Output
"use strict";
console.log(Number.isInteger(1));
const arr = [1, 2, 3];
console.log(arr.entries());

Compiler Options
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "target": "ES2017",
    "jsx": "react",
    "module": "ESNext",
    "moduleResolution": "node"
  }
}

Playground Link: Provided

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