Closed cfregin closed 4 years ago
@cfregin can you please mention the super_enum_generator
version you are using? Try upgrading to the latest v0.5.0
.
I am using super_enum_generator: ^0.5.0
dev_dependencies:
lint: ^1.1.1
analysis_options.yaml
include: package:lint/analysis_options.yaml
This shouldn't be a problem as we are following effective dart guidelines. https://dart.dev/guides/language/effective-dart/design#avoid-using-futureort-as-a-return-type
Ok, but the linter errors still exists. I could use super_enum now only by moving all enums to an extra folder where I can override the linter rules.
In this Github Repository I added linter tests for lint, package lint, effective dart and pedantic. All of them are failing. It would be nice, if you could add an
// ignore_for_file: return_of_invalid_type,constant_identifier_names, prefer_const_constructors_in_immutables, unnecessary_this, sort_unnamed_constructors_first, join_return_with_assignment
or fix the warnings.
I'm facing the same issue. The lintner shows a bunch of errors in generated files.
Okay, I'll soon look into this and fix this in the next release.
@cfregin, @klisiewicz I need to change the whole part builder
in order to add ignore rules in file headers, If this is urgent, you can create a build.yaml
file in your local project and add these lines for autogenerating it.
For example https://github.com/dart-lang/source_gen/blob/master/example_usage/build.yaml
targets:
$default:
builders:
source_gen|combining_builder:
options:
ignore_for_file:
- return_of_invalid_type
- constant_identifier_names
- prefer_const_constructors_in_immutables
- unnecessary_this
- sort_unnamed_constructors_first
- join_return_with_assignment
Fixed in #59
I do get a linter error 'return_of_invalid_type' in the generated and not R.
(Flutter (Channel beta, v1.14.6, on Mac OS X 10.15.3 19D76, locale de-DE))
R when<R>
,R whenOrElse<R>
etc. methods. you are returning a FutureOr