function getFilePathOrExternalSource({ rootPath, localPath }) {
  if (!localPath.startsWith('.')) {
    // We are not resolving external files like '@lion/input-amount/x.js',
    // but we give a 100% score if from and to are same here..
    return localPath;
  }
  return /** @type {PathRelativeFromProjectRoot} */ (
    toPosixPath(path.resolve(rootPath, localPath))
  );
}
@param {{rootPath:PathFromSystemRoot; localPath:PathRelativeFromProjectRoot}} opts
@returns {PathRelativeFromProjectRoot}