Skip to content

Commit d4d1c26

Browse files
fix(correct-ts-specifiers): prevent subpath key treated as directory (#76)
1 parent 324663a commit d4d1c26

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

recipes/correct-ts-specifiers/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ project-root/
6262
* [Package.json subpath imports](https://nodejs.org/api/packages.html#subpath-imports)
6363
* [tsconfig paths](https://www.typescriptlang.org/tsconfig/#paths) (via [`@nodejs-loaders/alias`](https://github.com/JakobJingleheimer/nodejs-loaders/blob/main/packages/alias?tab=readme-ov-file))
6464
* In order to subsequently run code via node, you will need to add this (or another) loader to your own project. Or, switch to [subimports](https://nodejs.org/api/packages.html#subpath-imports).
65-
* ⚠️ Using `subpath imports` along side `tsconfig paths` can lead to interference (it's better to use one or the other, not both).
6665
* Commonjs-like directory specifiers
6766

6867
Before:

recipes/correct-ts-specifiers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
},
3838
"dependencies": {
3939
"@codemod.com/workflow": "^0.0.31",
40-
"@nodejs-loaders/alias": "^2.1.1"
40+
"@nodejs-loaders/alias": "^2.1.2"
4141
}
4242
}
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"compilerOptions": {
3-
"baseUrl": "./",
4-
"allowImportingTsExtensions": true,
5-
"module": "nodenext",
6-
"noEmit": true,
7-
"paths": {
8-
"…/*": ["./*"]
9-
}
10-
}
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"allowImportingTsExtensions": true,
5+
"module": "nodenext",
6+
"noEmit": true,
7+
"paths": {
8+
"…/*": [
9+
"./*",
10+
],
11+
"*": [
12+
"./*",
13+
],
14+
}
15+
}
1116
}

0 commit comments

Comments
 (0)