Skip to content

proposal: lint to flag when an exported API uses types that are not exported #58731

@Hixie

Description

@Hixie

It would be great to have a lint that flags when an exported API uses types that are not themselves exported.

For example:

// library a

class Foo { }
// library b
import 'package:a/a.dart';

abstract class Bar {
  Foo get foo;
}

// ...

Library b should lint that Foo is not exported, correction would be:

// library b
import 'package:a/a.dart';
export 'package:a/a.dart' show Foo; // <--

abstract class Bar {
  Foo get foo;
}

// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposallinter-status-pendingtype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions