Code Sharp Linter for Dart

Lint Rules

Using the Linter

Supported Lint Rules

This list is auto-generated from our sources.

Rules are organized into familiar rule groups.

In addition, rules can be further distinguished by maturity. Unqualified rules are considered stable, while others may be marked experimental to indicate that they are under review. Lints that are marked as deprecated should not be used and are subject to removal in future Linter releases.

Rules can be selectively enabled in the analyzer using analysis options or through an analysis options file.

As some lints may contradict each other, only a subset of these will be enabled in practice, but this list should provide a convenient jumping-off point.

Many lints are included in various predefined rulesets:

Rules included in these rulesets are badged in the documentation below.

These rules are under active development. Feedback is welcome!

Error Rules

Style Rules

argument_equal_default_no_need_set
flutter

The argument '{0}' equal default({1}) no need set.

prefer_builder_constructor_for_widget

Prefer use {0}.builder constructor.

prefer_if_null_operators_with_default_bool
recommendedflutter

Prefer using if null operators with default bool value.

prefer_method_not_use_calls
recommendedflutter

Prefer method direct calls instead of call calls.

prefer_switch_case
recommendedflutter

Prefer switch case instead of multiple if else processes.

use_container_property_as_possible
flutter

Use Container '{0}' property as possible.

Pub Rules