@@ -9,13 +9,17 @@ Turn on transpile-free type hinting for your vanilla JS projects #JSWithTypes
992 . 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 ```
14143 . Profit!
1515
1616Works 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 ```
56602 . 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 ```
61663 . Renames ` tsconfig.json ` to ` jsconfig.json ` \
0 commit comments