Group: style
Maturity: stable
Dart SDK: >= 2.0.0 • (Linter v0.1.1)
DO provide doc comments for all public APIs.
As described in the pub package layout doc,
public APIs consist in everything in your package's lib
folder, minus
implementation files in lib/src
, adding elements explicitly exported with an
export
directive.
For example, given lib/foo.dart
:
export 'src/bar.dart' show Bar;
export 'src/baz.dart';
class Foo { }
class _Foo { }
its API includes:
Foo
(but not _Foo
)Bar
(exported) andsrc/baz.dart
All public API members should be documented with ///
doc-style comments.
GOOD:
/// A Foo.
abstract class Foo {
/// Start foo-ing.
void start() => _start();
_start();
}
BAD:
class Bar {
void bar();
}
Advice for writing good doc comments can be found in the Doc Writing Guidelines.