Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jun 1, 2022
1 parent 2e94032 commit b124d25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/resolver-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ export function createResolverFunctions(kwargs: {
containingSourceFile?: TSCommon.SourceFile
): (TSCommon.ResolvedModule | undefined)[] => {
return moduleNames.map((moduleName, i) => {
const mode = containingSourceFile ? (ts as any as TSInternal).getModeForResolutionAtIndex?.(containingSourceFile, i) : undefined;
const mode = containingSourceFile
? (ts as any as TSInternal).getModeForResolutionAtIndex?.(
containingSourceFile,
i
)
: undefined;
const { resolvedModule } = ts.resolveModuleName(
moduleName,
containingFile,
config.options,
host,
moduleResolutionCache,
redirectedReference,
mode,
mode
);
if (resolvedModule) {
fixupResolvedModule(resolvedModule);
Expand Down
9 changes: 6 additions & 3 deletions src/ts-compiler-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export interface TSInternal {
usage: 'files' | 'directories' | 'exclude'
): string | undefined;
// Added in TS 4.7
getModeForResolutionAtIndex?(file: TSInternal.SourceFileImportsList, index: number): _ts.SourceFile['impliedNodeFormat'];
getModeForResolutionAtIndex?(
file: TSInternal.SourceFileImportsList,
index: number
): _ts.SourceFile['impliedNodeFormat'];
}
/** @internal */
export namespace TSInternal {
Expand All @@ -131,6 +134,6 @@ export namespace TSInternal {
}
// Note: is only a partial declaration, TS sources declare other fields
export interface SourceFileImportsList {
impliedNodeFormat?: TSCommon.SourceFile["impliedNodeFormat"];
};
impliedNodeFormat?: TSCommon.SourceFile['impliedNodeFormat'];
}
}

0 comments on commit b124d25

Please sign in to comment.