-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support package.json subpath imports
If you specify an "imports" field in package.json it is used to resolved imports starting with "#" in the code. For more details, see https://nodejs.org/api/packages.html#subpath-imports
- Loading branch information
Showing
5 changed files
with
184 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable no-unused-vars */ | ||
|
||
// Import some of the modules specified in package.json "imports" field so those are | ||
// considered used by depcheck | ||
|
||
import '#simple'; | ||
import '#subpath'; | ||
import '#conditional'; | ||
import '#multi-conditional'; | ||
import '#missing'; | ||
import '#wildcard/foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"imports": { | ||
"#simple": "simple-resolved", | ||
"#subpath": "subpath-resolved/subpath", | ||
"#wildcard/*": "wildcard-resolved/*", | ||
"#conditional": { | ||
"node": "conditional-node", | ||
"types": "@types/conditional" | ||
}, | ||
"#multi-conditional": { | ||
"node": { | ||
"test": "conditional-node-test" | ||
} | ||
}, | ||
"#simple-unused": "unused", | ||
"#subpath-unused": "subpath-resolved-unused/subpath", | ||
"#conditional-unused": { | ||
"node": "conditional-node-unused" | ||
}, | ||
"#missing": "missing-dep" | ||
}, | ||
"dependencies": { | ||
"simple-resolved": "0.0.1", | ||
"subpath-resolved": "0.0.1", | ||
"conditional-node": "0.0.1", | ||
"@types/conditional": "0.0.1", | ||
"conditional-node-test": "0.0.1", | ||
"unused": "*", | ||
"conditional-node-unused": "*", | ||
"subpath-resolved-unused": "*", | ||
"wildcard-resolved": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters