Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!