File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @feature-sliced/filesystem" ,
3- "version" : " 2.2.3 " ,
3+ "version" : " 2.2.4 " ,
44 "description" : " A set of utilities for locating and working with FSD roots in the file system." ,
55 "scripts" : {
66 "build" : " tsup src/index.ts --dts --format esm,cjs --clean" ,
Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ export function resolveImport(
5656
5757const imperfectKeys = {
5858 module : ts . ModuleKind ,
59- moduleResolution : ts . ModuleResolutionKind ,
59+ moduleResolution : {
60+ ...ts . ModuleResolutionKind ,
61+ node : ts . ModuleResolutionKind . Node10 ,
62+ } ,
6063 moduleDetection : ts . ModuleDetectionKind ,
6164 newLine : ts . NewLineKind ,
6265 target : ts . ScriptTarget ,
@@ -90,7 +93,8 @@ export interface ImperfectCompilerOptions
9093 module ?: ts . ModuleKind | keyof typeof ts . ModuleKind ;
9194 moduleResolution ?:
9295 | ts . ModuleResolutionKind
93- | keyof typeof ts . ModuleResolutionKind ;
96+ | keyof typeof ts . ModuleResolutionKind
97+ | "node" ;
9498 moduleDetection ?:
9599 | ts . ModuleDetectionKind
96100 | keyof typeof ts . ModuleDetectionKind ;
Original file line number Diff line number Diff line change @@ -23,3 +23,26 @@ test("Basic", () => {
2323 ) ,
2424 ) . toBe ( "src/shared/ui/index.ts" ) ;
2525} ) ;
26+
27+ test ( "With deprecated moduleResolution: node" , ( ) => {
28+ const tsCompilerOptions = {
29+ moduleResolution : "node" as const ,
30+ baseUrl : "." ,
31+ paths : {
32+ "~/*" : [ "./src/*" ] ,
33+ } ,
34+ } ;
35+
36+ function fileExists ( path : string ) {
37+ return path === "src/shared/ui/index.ts" ;
38+ }
39+
40+ expect (
41+ resolveImport (
42+ "~/shared/ui" ,
43+ "src/pages/home/ui/HomePage.tsx" ,
44+ tsCompilerOptions ,
45+ fileExists ,
46+ ) ,
47+ ) . toBe ( "src/shared/ui/index.ts" ) ;
48+ } ) ;
You can’t perform that action at this time.
0 commit comments