@@ -290,12 +290,13 @@ namespace ts {
290290
291291 const typeRoots : string [ ] = [ ] ;
292292 for ( const [ name , referencish ] of Array . from < any > ( packageDependencies . entries ( ) ) ) {
293- if ( name . startsWith ( typesPackagePrefix ) && referencish !== null ) {
294- const dependencyLocator = pnpapi . getLocator ( name , referencish ) ;
295- const { packageLocation} = pnpapi . getPackageInformation ( dependencyLocator ) ;
293+ // eslint-disable-next-line no-null/no-null
294+ if ( name . startsWith ( typesPackagePrefix ) && referencish !== null ) {
295+ const dependencyLocator = pnpapi . getLocator ( name , referencish ) ;
296+ const { packageLocation} = pnpapi . getPackageInformation ( dependencyLocator ) ;
296297
297- typeRoots . push ( getDirectoryPath ( packageLocation ) ) ;
298- }
298+ typeRoots . push ( getDirectoryPath ( packageLocation ) ) ;
299+ }
299300 }
300301
301302 return typeRoots ;
@@ -1575,7 +1576,7 @@ namespace ts {
15751576 * that the runtime has already been executed).
15761577 * @internal
15771578 */
1578- export function isPnpAvailable ( ) {
1579+ function isPnpAvailable ( ) {
15791580 // @ts -ignore
15801581 return process . versions . pnp ;
15811582 }
@@ -1587,15 +1588,18 @@ namespace ts {
15871588 function loadPnpPackageResolution ( packageName : string , containingDirectory : string ) {
15881589 try {
15891590 return getPnpApi ( ) . resolveToUnqualified ( packageName , `${ containingDirectory } /` , { considerBuiltins : false } ) ;
1590- } catch { }
1591+ }
1592+ catch {
1593+ // Nothing to do
1594+ }
15911595 }
15921596
15931597 function loadPnpTypePackageResolution ( packageName : string , containingDirectory : string ) {
15941598 return loadPnpPackageResolution ( getTypesPackageName ( packageName ) , containingDirectory ) ;
15951599 }
15961600
15971601 /* @internal */
1598- export function tryLoadModuleUsingPnpResolution ( extensions : Extensions , moduleName : string , containingDirectory : string , state : ModuleResolutionState ) {
1602+ function tryLoadModuleUsingPnpResolution ( extensions : Extensions , moduleName : string , containingDirectory : string , state : ModuleResolutionState ) {
15991603 const { packageName, rest} = parsePackageName ( moduleName ) ;
16001604
16011605 const packageResolution = loadPnpPackageResolution ( packageName , containingDirectory ) ;
@@ -1606,7 +1610,8 @@ namespace ts {
16061610 let resolved ;
16071611 if ( packageFullResolution ) {
16081612 resolved = packageFullResolution ;
1609- } else if ( extensions === Extensions . TypeScript || extensions === Extensions . DtsOnly ) {
1613+ }
1614+ else if ( extensions === Extensions . TypeScript || extensions === Extensions . DtsOnly ) {
16101615 const typePackageResolution = loadPnpTypePackageResolution ( packageName , containingDirectory ) ;
16111616 const typePackageFullResolution = typePackageResolution
16121617 ? nodeLoadModuleByRelativeName ( Extensions . DtsOnly , combinePaths ( typePackageResolution , rest ) , /*onlyRecordFailures*/ false , state , /*considerPackageJson*/ true )
0 commit comments