Generate a tsconfig.json for VSCode to use
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
I created a mini project testing top-level await and VSCode is complaining about it, even though the tsup configuration is working and compiling the file, is there a way to generate a tsconfig from tsup for VSCode to see?
index.ts
```typescript
export const delay = (ms: number) =>
new Promise(resolve => setTimeout(resolve, ms))
console.log('Hello')
await delay(1000)
console.log('There')
```
tsup.config.ts
```typescript
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
watch: true,
target: 'node16',
format: 'esm',
onSuccess: 'node dist/index.mjs',
})
```
Error VS Code
```bash
Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.ts(1378)
```
Contributor guide
Assessment
This issue has not been assessed yet.