JoshuaKGoldberg / JoshuaKGoldberg/TypeStat

extends tsconfig.json can't resolve @tsconfig/ package

Open
#1,306 4 comments 0 reactions 0 assignees View on GitHub
status: accepting prs type: bug
Dominant language
TypeScript
Stars
2.3k
Forks
47
Avg merge
15h 55m
Merged PRs (30d)
21

Description

### 🐛 Bug Report

- TypeStat version: 0.7.2
- TypeScript version: 5.1.6
- Node version: v16.18.0

#### Actual Behavior

```
Error: ENOENT: no such file or directory, stat 'node_modules/@tsconfig/node16/tsconfig.json/package.json'
```

The correct file should be `node_modules/@tsconfig/node16/tsconfig.json`

A temporary fix is updating the tsconfig.json with `./node_modules/@tsconfig/node16/tsconfig.json`

#### Expected Behavior

Run without an error

#### Reproduction

```
vi tsconfig.json
{
"extends": "@tsconfig/node16/tsconfig.json",
"include": [
"src/**/*"
]
}

npx typestat
npx typestat --config typestat.json
```

```ts
// typestat.json
{
"files": {
"renameExtensions": false
},
"fixes": {
"incompleteTypes": true,
"missingProperties": true,
"noImplicitAny": true
},
"cleanups": {
"suppressTypeErrors": true
},
"include": [
"src/**/*.{js,jsx}"
],
"project": "./tsconfig.json"
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.