Skip to content

Instantly share code, notes, and snippets.

@nandorojo
Last active March 30, 2023 16:40
Show Gist options
  • Save nandorojo/a1a1a38e97e3bd25ba815ab32cc4a900 to your computer and use it in GitHub Desktop.
Save nandorojo/a1a1a38e97e3bd25ba815ab32cc4a900 to your computer and use it in GitHub Desktop.
How to use TypeScript 5.0 Beta with Expo SDK 48 or 47

https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta

Babel

Add the following resolutions to your package.json:

{
  "resolutions": {
    "@babel/preset-typescript": "^7.21.0",
    "@babel/core": "^7.21.0",
    "@babel/plugin-transform-typescript": "^7.21.0"
  }
}

Once Expo adds support for this (likely in SDK 49), you should remove these resolutions.

ESLint

At the time of writing this, TS is at 5.0.2. I added the following resolutions to get ESLint support too. However, keep in mind that ESLint doesn't add full support for TypeScript versions before they're stable, so there may be some issues.

{
  "resolutions": {
    "@typescript-eslint/eslint-plugin": "5.57.0",
    "@typescript-eslint/parser": "5.57.0"
  }
}

Once Expo adds support for this (likely in SDK 49), you should remove these resolutions.

Prettier

You should upgrade this to latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment