Closed remonh87 closed 3 years ago
When I generate code for the following class
@FunctionalData() class Bar extends $Bar{ Bar({this.foo}); final String foo; }
It results in:
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'bar.dart'; // ************************************************************************** // FunctionalDataGenerator // ************************************************************************** // ignore_for_file: join_return_with_assignment // ignore_for_file: avoid_classes_with_only_static_members // ignore_for_file: non_constant_identifier_names // ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes abstract class $Bar { const $Bar(); String get foo; Bar copyWith({String foo}) => Bar(foo: foo ?? this.foo); @override String toString() => "Bar(foo: $foo)"; @override bool operator ==(dynamic other) => other.runtimeType == runtimeType && foo == other.foo; @override int get hashCode { var result = 17; result = 37 * result + foo.hashCode; return result; } } class Bar$ { static final foo = Lens<Bar, String>((s_) => s_.foo, (s_, foo) => s_.copyWith(foo: foo)); }
This generated code has 2 violations to dart lint.
I will submit a pr that will fix this.
I'm closing this issue with the rationale given in the linked PR: those lint rules are opinions (there are similar rules for the opposite).
yes you are right it would conflict others
When I generate code for the following class
It results in:
This generated code has 2 violations to dart lint.
I will submit a pr that will fix this.