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

123
Vistas
How to add an eslint rule to force explicit return type on functions that have return only?

I found an eslint rule that lets me ensure that the return type is always set. I need a way to force explicit return type on all functions expect those that don't have a return. So, I won't need to set void as return type if there's no return statement in the function. I'm working on a big code base and explicitly setting void as return type would force me to edit a lot of lines in the code base.

I don't want eslint to show a warning on the first function, but I want it show a warning on the second function.

function hello() {
  console.log('hello world')
}

function myNumber() {
  return 1
}

Is this possible? If so, which rule should I use?

about 4 years ago · Juan Pablo Isaza
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