Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update lints for dart 3.1 #421

Merged
merged 7 commits into from
Oct 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: update lints for dart 3.1
knaeckeKami committed Oct 7, 2023

Unverified

The committer email address is not verified.
commit a13cb86ddef649818c0c29bc4a6eab2fa9641018
4 changes: 2 additions & 2 deletions codegen/gql_code_builder/lib/data.dart
Original file line number Diff line number Diff line change
@@ -71,13 +71,13 @@ Library buildDataLibrary(
}

Map<String, SourceSelections> _fragmentMap(SourceNode source) => {
for (var def
for (final def
in source.document.definitions.whereType<FragmentDefinitionNode>())
def.name.value: SourceSelections(
url: source.url,
selections: def.selectionSet.selections,
),
for (var import in source.imports) ..._fragmentMap(import)
for (final import in source.imports) ..._fragmentMap(import)
};

Map<String, Reference> _dataClassAliasMap(
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ List<Method> _inlineFragmentRootSerializationMethods({
/// TODO: Handle inline fragments without a type condition
/// https://spec.graphql.org/June2018/#sec-Inline-Fragments
{
for (var v in inlineFragments
for (final v in inlineFragments
.where((frag) => frag.typeCondition != null))
"${v.typeCondition!.on.name.value}": dataClassAliasMap[
"${name}__as${v.typeCondition!.on.name.value}"] ??
4 changes: 2 additions & 2 deletions codegen/gql_code_builder/lib/var.dart
Original file line number Diff line number Diff line change
@@ -30,10 +30,10 @@ Library buildVarLibrary(
.toList();

Map<String, FragmentDefinitionNode> _fragmentMap(SourceNode source) => {
for (var def
for (final def
in source.document.definitions.whereType<FragmentDefinitionNode>())
def.name.value: def,
for (var import in source.imports) ..._fragmentMap(import)
for (final import in source.imports) ..._fragmentMap(import)
};

final fragmentVarClasses = docSource.document.definitions
2 changes: 0 additions & 2 deletions gql_pedantic/lib/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ linter:
- no_duplicate_case_values
- null_closures
- prefer_contains
- prefer_equal_for_default_values
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
@@ -32,7 +31,6 @@ linter:
- valid_regexps
# pedantic 1.9.0
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_null_checks_in_equality_operators
- camel_case_extensions
2 changes: 1 addition & 1 deletion links/gql_http_link/test/mocks/http.dart
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@ import "package:mockito/annotations.dart";
export "./http.mocks.dart";

@GenerateMocks([], customMocks: [
MockSpec<http.Client>(returnNullOnMissingStub: true, as: #MockHttpClient)
MockSpec<http.Client>(onMissingStub: OnMissingStub.returnDefault, as: #MockHttpClient)
])
void main() {}