Skip to content

Commit 7c8ebfd

Browse files
authored
Update TS Instructions for Simplified Template
facebook/react-native#35529 simplifies the ESLint config of the template a bit more compared to the previous version, more directly derived from the community template. I expect it will be cherry-picked into 0.71, so this updates the corresponding TS documentation on adding TS to a non-TS project to remove the extra differences.
1 parent 20baa2b commit 7c8ebfd

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

docs/typescript.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ npx create-expo-app --template
2525
<TabItem value="npm">
2626

2727
```shell
28-
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
28+
npm install -D @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
2929
```
3030

3131
</TabItem>
3232
<TabItem value="yarn">
3333

3434
```shell
35-
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
35+
yarn add --dev @tsconfig/react-native @types/jest @types/react @types/react-test-renderer typescript
3636
```
3737

3838
</TabItem>
@@ -50,22 +50,11 @@ This command adds the latest version of every dependency. The versions may need
5050
}
5151
```
5252

53-
3. Update your `.eslintrc.js` to enable TypeScript specific linting rules:
54-
55-
```diff
56-
module.exports = {
57-
root: true,
58-
extends: '@react-native-community',
59-
+ parser: '@typescript-eslint/parser',
60-
+ plugins: ['@typescript-eslint'],
61-
};
62-
```
63-
64-
4. Rename a JavaScript file to be `*.tsx`
53+
3. Rename a JavaScript file to be `*.tsx`
6554

6655
> You should leave the `./index.js` entrypoint file as it is otherwise you may run into an issue when it comes to bundling a production build.
6756
68-
5. Run `yarn tsc` to type-check your new TypeScript files.
57+
4. Run `yarn tsc` to type-check your new TypeScript files.
6958

7059
## Using JavaScript Instead of TypeScript
7160

0 commit comments

Comments
 (0)