* A JS/TS `imports` reference to the module of an import named by one bare * segment — `'config'` in `import { DEFAULT_THEME_MODE } from 'config'` under * `"baseUrl": "src"`. Shaped like a package, it names a file only when * resolveImportPath finds one (the app's `baseUrl` or catch-all `paths`,
(ref: UnresolvedRef, context: ResolutionContext)
| 2966 | * binds locally is that binding, not the module, and resolves as one. |
| 2967 | */ |
| 2968 | function isJsBareModuleRef(ref: UnresolvedRef, context: ResolutionContext): boolean { |
| 2969 | if (ref.referenceKind !== 'imports' || !ESM_IMPORT_LANGUAGES.has(ref.language) || isJsPathSpecifier(ref.referenceName)) return false; |
| 2970 | const imports = context.getImportMappings(ref.filePath, ref.language); |
| 2971 | return importsFrom(imports, ref.referenceName).length > 0 && importsBoundTo(imports, ref.referenceName).length === 0; |
| 2972 | } |
| 2973 | |
| 2974 | /** |
| 2975 | * The file a JS/TS module reference names, the way resolveViaImport reads it: |
no test coverage detected