extend-equatable
- Group
- Style
- Path
lint/style/extend-equatable- Default
- Off, opt in
- Origin
- Falcon
- Domain
- equatable
- Rule
- 235 of 512
Require Equatable semantics for configured class/file name patterns.
Configure class-name-pattern or file-name-pattern; without either option,
this rule reports no diagnostics. Already equatable subtypes (including
EquatableMixin users) and unresolved inheritance are conservatively skipped.
Invalid
import 'package:equatable/equatable.dart';
class FirstState {}
class SecondState {}
abstract class ThirdState {}
class FourthState extends Base {}
class FifthState with Other {}
class Base {}
mixin Other {}import 'package:equatable/equatable.dart';class FirstState {}class FirstState {}class SecondState {}class SecondState {}abstract class ThirdState {}abstract class ThirdState {}class FourthState extends Base {}class FourthState extends Base {}class FifthState with Other {}Valid
import 'package:equatable/equatable.dart';
import 'package:equatable/equatable.dart' as eq;
class FirstState extends Equatable {}
class SecondState with EquatableMixin {}
class ThirdState extends FirstState {}
class FourthState extends eq.Equatable {}
class FifthState with eq.EquatableMixin {}
class NotConfigured {}
class UnknownState extends Missing {}
class InterfaceState implements Equatable {}
mixin class ViewState {}Configure extend-equatable
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"extend-equatable": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/extend-equatable: <reason>More style rules
- file-names
file_namesrecommendedEnforces
lowercase_with_underscoresfor source file names. - flutter-style-todos
flutter_style_todosFlags
TODOcomments that do not follow the Flutter style// TODO(username): message, https://URL-to-issue. - format-comment
format-commentFlags comments that are not formatted as complete sentences.
- implicit-call-tearoffs
implicit_call_tearoffsExplicitly tear off callable objects' call methods.
- initializers-ordering
Requires field initializers to follow their containing type's field declaration order by default.
- leading-newlines-in-multiline-strings
leading_newlines_in_multiline_stringsFlags a multiline string spanning several lines whose text does not start with a line break right after the opening quotes.
- library-annotations
library_annotationsrecommendedRequires library-targeted metadata to attach to a
librarydirective. - library-names
library_namesrecommendedFlags a library name that is not
lowercase_with_underscores.