Home > front end >  In Typescript, is there a way to make function parameters typing mandatory
In Typescript, is there a way to make function parameters typing mandatory

Time:07-02

I'm working on a big project with JS and TS files and sometimes there are no types on Typescript functions.

Since we want to use typescript to type things I would like to have a way to make function parameters mandatory with typescript CLI or ESLint, is this possible ?

Did not find anything on it.

CodePudding user response:

TSConfig option noImplicitAny will ensure that parameters are specified and not assumed to be any.

noImplicitReturns will also help for return types.

  • Related