Skip to main content

extra_pedantic 6.0.1 copy "extra_pedantic: ^6.0.1" to clipboard
extra_pedantic: ^6.0.1 copied to clipboard

Stricter Dart analyzer linter settings and best practices.

example/README.md

extra_pedantic example #

Add extra_pedantic as a dev dependency in pubspec.yaml:

dev_dependencies:
  extra_pedantic: ^6.0.1

Include it in analysis_options.yaml:

include: package:extra_pedantic/analysis_options.yaml

Then run dart analyze. For example, extra_pedantic reports these:

Future<int> load(Future<int> value) async {
  // async_return_with_no_await: return await value instead.
  return value;
}

void describe(dynamic value) {
  // no_dynamic_casts: write `value as int` to make the cast visible.
  final int number = value;
  // no_raw_types: write List<int> instead of List.
  final List numbers = <int>[number];
  // use_truncating_division: use ~/ instead of / followed by toInt().
  print((numbers.length / 2).toInt());
}

To keep your own rules on top, add them below the include:

include: package:extra_pedantic/analysis_options.yaml

linter:
  rules:
    avoid_print: true
23
likes
160
points
4.11k
downloads

Documentation

API reference

Publisher

verified publishermodulovalue.com

Weekly Downloads

Stricter Dart analyzer linter settings and best practices.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

More

Packages that depend on extra_pedantic