Skip to content

Commit 927f627

Browse files
authored
Use "target": "esnext” (#33)
1 parent 7f34b7e commit 927f627

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

readme.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> Shared [TypeScript config](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) for my projects
44
5+
This config makes TypeScript not do any polyfilling, so only use syntax and features available in the JavaScript environments you target.
6+
57
## Install
68

79
```sh
@@ -19,14 +21,3 @@ npm install --save-dev @sindresorhus/tsconfig
1921
"extends": "@sindresorhus/tsconfig"
2022
}
2123
```
22-
23-
When you are targeting a higher version of Node.js, check the relevant ECMAScript version and add it as `target`:
24-
25-
```json
26-
{
27-
"extends": "@sindresorhus/tsconfig",
28-
"compilerOptions": {
29-
"target": "ES2023"
30-
}
31-
}
32-
```

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"module": "node16",
55
"moduleResolution": "node16",
66
"moduleDetection": "force",
7-
"target": "ES2022", // Node.js 18
7+
"target": "esnext",
88
"lib": [
99
"DOM",
1010
"DOM.Iterable",
11-
"ES2022"
11+
"ES2022" // Node.js 18
1212
],
1313
"resolveJsonModule": false, // ESM doesn't yet support JSON modules.
1414
"jsx": "react",

0 commit comments

Comments
 (0)