Skip to content

[linter][unnecessary_async] no unnecessary async detected #62285

@stephane-archer

Description

@stephane-archer
Future<bool> _isConsolidatableExternalLink(
    Link link, String libraryRootPath) async {
  final targetPath = link.resolveSymbolicLinksSync();

  // A link is NOT consolidatable if it points inside the library itself.
  final isInsideLibrary = path_lib.equals(targetPath, libraryRootPath) ||
      path_lib.isWithin(libraryRootPath, targetPath);
  if (isInsideLibrary) return false;

  // A link is NOT consolidatable if it points to an ancestor of the library.
  // This would create a recursive loop where the library tries to consolidate
  // its own parent directory.
  final isAncestorOfLibrary = path_lib.isWithin(targetPath, libraryRootPath);
  if (isAncestorOfLibrary) return false;

  return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions