Skip to content

Commit 82190c7

Browse files
committed
doc: update README.md for v2 and ESM
1 parent 2fc0206 commit 82190c7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ Turn on transpile-free type hinting for your vanilla JS projects #JSWithTypes
99
2. Turn on type linting 💪
1010
```sh
1111
# Create a properly configured `jsconfig.json`
12-
npx jswt init
12+
npx -p jswt@2.x -- jswt init
1313
```
1414
3. Profit!
1515

1616
Works with **VS Code** out-of-the-box, and
1717
[Vim + ale](https://webinstall.dev/vim-essentials).
1818

19+
## CommonJS vs ESM
20+
21+
Use v1 for CommonJS, or v2 for ESM.
22+
1923
## Watch the Presentation!
2024

2125
[![JS with Types conference title slide](https://jswithtypes.com/assets/utahjs-conf-2022-jswt-title-yt.png)](https://jswithtypes.com/)
@@ -49,13 +53,14 @@ Your project will look something like this:
4953
npx -p typescript@5.x -- \
5054
tsc --init \
5155
--allowJs --alwaysStrict --checkJs \
52-
--moduleResolution node \
53-
--noEmit --noImplicitAny --target es2022 \
56+
--module nextnode --moduleResolution nextnode \
57+
--noEmit --noImplicitAny --target es2024 \
5458
--typeRoots './typings,./node_modules/@types'
5559
```
5660
2. Adds the following keys:
5761
```txt
58-
"include": ["*.js", "bin/**/*.js", "lib/**/*.js", "src/**/*.js"]`
62+
"paths": { "foo": ["./foo.js"], "foo/*": ["./*"] },
63+
"include": ["*.js", "bin/**/*.js", "lib/**/*.js", "src/**/*.js"]`,
5964
"exclude": ["node_modules"]
6065
```
6166
3. Renames `tsconfig.json` to `jsconfig.json` \

0 commit comments

Comments
 (0)