Programming Search⌘K

Dart lints, page 1 of 2

The lint rules of Dart, with what each one finds. This page has 264 cards.

Constructors in a deprecated class should be deprecated. deprecated_consistency

Try marking the constructor as deprecated. Its category is style. It is stable since Dart 2.13.

Code
deprecated_consistency
Message
Constructors in a deprecated class should be deprecated.
Message
Fields that are initialized by a deprecated parameter should be deprecated.
Message
Parameters that initialize a deprecated field should be deprecated.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

'…' is deprecated and shouldn't be used. …. deprecated_member_use_from_same_package

Try replacing the use of the deprecated member with the replacement, if a replacement is specified. Its category is languageFeatureUsage. It is stable since Dart 3.0.

Code
deprecated_member_use_from_same_package
Message
'{}' is deprecated and shouldn't be used. {}
Message
'{}' is deprecated and shouldn't be used.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

Sort directive sections alphabetically. directives_ordering

Try sorting the directives. Its category is style. It is stable since Dart 2.0.

Code
directives_ordering
Message
Sort directive sections alphabetically.
Message
Place 'dart:' {} before other {}.
Message
Specify exports in a separate section after all imports.
Message
Place 'package:' {} before relative {}.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

Catch clause with type '…' checks whether the caught value is a JS interop type, which might not be platform-consistent. invalid_runtime_check_with_js_interop_types

Remove the type in the catch clause and try using 'isA' from 'dart:js_interop' within the catch block to check if the value is a JS interop type.

Code
invalid_runtime_check_with_js_interop_types
Message
Catch clause with type '{}' checks whether the caught value is a JS interop type, which might not be platform-consistent.
Message
Cast from '{}' to '{}' casts a Dart value to a JS interop type, which might not be platform-consistent.
Message
Runtime check between '{}' and '{}' checks whether a Dart value is a JS interop type, which might not be platform-consistent.
Message
Runtime check or cast between '{}' and '{}' involves both a 'dart:js_interop' type and a 'dart:js' type, which are unrelated. 'dart:js' types are Dart wrappers around JS values and aren't JS values themselves.
Message
Cast from '{}' to '{}' casts a JS interop value to a Dart type, which might not be platform-consistent.
Message
Cast from '{}' to '{}' casts a JS interop value to an incompatible JS interop type, which might not be platform-consistent.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The super parameter named '…' does not share the same name as the corresponding parameter in the super constructor, '…'. matching_super_parameters

Try using the name of the corresponding parameter in the super constructor. Its category is style. It is stable since Dart 3.0.

Code
matching_super_parameters
Message
The super parameter named '{}' does not share the same name as the corresponding parameter in the super constructor, '{}'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The comparison is always 'false' because the length is always greater than or equal to 0. prefer_is_empty

Its category is errorProne.

Code
prefer_is_empty
Message
The comparison is always 'false' because the length is always greater than or equal to 0.
Message
The comparison is always 'true' because the length is always greater than or equal to 0.
Message
Use 'isEmpty' instead of 'length' to test whether the collection is empty.
Message
Use 'isNotEmpty' instead of 'length' to test whether the collection is empty.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.