mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Reprioritize cross-project module specifier suggestions for auto-import (#40253)
* Add test * Suggest `paths` module specifiers even when a node_modules path was available * Fix some tests * Fix remaining tests * Add comments
This commit is contained in:
@@ -68,6 +68,14 @@ namespace ts {
|
||||
return /^\.\.?($|[\\/])/.test(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a path is neither relative nor absolute, e.g. "path/to/file".
|
||||
* Also known misleadingly as "non-relative".
|
||||
*/
|
||||
export function pathIsBareSpecifier(path: string): boolean {
|
||||
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
||||
}
|
||||
|
||||
export function hasExtension(fileName: string): boolean {
|
||||
return stringContains(getBaseFileName(fileName), ".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user