* 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)
| 3212 | * binds locally is that binding, not the module, and resolves as one. |
| 3213 | */ |
| 3214 | function isJsBareModuleRef(ref: UnresolvedRef, context: ResolutionContext): boolean { |
| 3215 | if (ref.referenceKind !== 'imports' || !ESM_IMPORT_LANGUAGES.has(ref.language) || isJsPathSpecifier(ref.referenceName)) return false; |
| 3216 | const imports = context.getImportMappings(ref.filePath, ref.language); |
| 3217 | return importsFrom(imports, ref.referenceName).length > 0 && importsBoundTo(imports, ref.referenceName).length === 0; |
| 3218 | } |
| 3219 | |
| 3220 | /** |
| 3221 | * The file a JS/TS module reference names, the way resolveViaImport reads it: |
no test coverage detected