skip to Main Content

Making a React Native app with expo/typescript and since I’m working in a team I want to disable use of type:any since it happened a couple of times someone puts it and forgets to remove it and it doesn’t end well usually

{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "strictNullChecks": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitAny": true,
    "allowUnreachableCode": false,
    "strictFunctionTypes": true,
  },
}

This is my current tsconfig.json

2

Answers


  1. You’ll need the no-explicit-any from typescript-eslint !

    The basic ts setting doesn’t have that option.

    Login or Signup to reply.
  2. TypeScript itself doesn’t have a setting for that, but typescript-eslint has one: no-explicit-any.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search