Skip to content

Commit 192d698

Browse files
committed
fix(dart_frog): update ignore_for_file comments and type definitions
- Add lines_longer_than_80_chars ignore to multiple files - Update ModelConfig type to include dynamic - Add various ignores to data route files for specific lint rules
1 parent d6d5427 commit 192d698

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

lib/src/providers/countries_client_provider.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@
3434
//
3535
// This `providers` directory is kept primarily as a reference to the standard
3636
// individual provider pattern or for potential future use with dependencies
37+
// ignore_for_file: lines_longer_than_80_chars
38+
3739
// that don't fit the generic data model structure.

lib/src/registry/model_registry.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// ignore_for_file: strict_raw_type
2+
// ignore_for_file: strict_raw_type, lines_longer_than_80_chars
33

44
import 'package:dart_frog/dart_frog.dart';
55
import 'package:ht_data_client/ht_data_client.dart';
@@ -51,7 +51,7 @@ class ModelConfig<T> {
5151
/// *metadata* needed to work with those repositories generically based on the
5252
/// request's `model` parameter.
5353
/// {@endtemplate}
54-
final modelRegistry = <String, ModelConfig>{
54+
final modelRegistry = <String, ModelConfig<dynamic>>{
5555
'headline': ModelConfig<Headline>(
5656
fromJson: Headline.fromJson,
5757
// toJson removed
@@ -75,7 +75,7 @@ final modelRegistry = <String, ModelConfig>{
7575
};
7676

7777
/// Type alias for the ModelRegistry map for easier provider usage.
78-
typedef ModelRegistryMap = Map<String, ModelConfig>;
78+
typedef ModelRegistryMap = Map<String, ModelConfig<dynamic>>;
7979

8080
/// Dart Frog provider function factory for the entire [modelRegistry].
8181
///

routes/api/v1/data/[id].dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//
2+
// ignore_for_file: lines_longer_than_80_chars, no_default_cases, avoid_catches_without_on_clauses, avoid_catching_errors
3+
14
import 'dart:io';
25

36
import 'package:dart_frog/dart_frog.dart';
@@ -129,7 +132,7 @@ Future<Response> _handlePut(
129132
RequestContext context,
130133
String id,
131134
String modelName,
132-
ModelConfig modelConfig,
135+
ModelConfig<dynamic> modelConfig,
133136
String requestId, // Receive requestId
134137
) async {
135138
final requestBody = await context.request.json() as Map<String, dynamic>?;

routes/api/v1/data/index.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//
2+
// ignore_for_file: lines_longer_than_80_chars, no_default_cases, avoid_catches_without_on_clauses, avoid_catching_errors
3+
14
import 'dart:io';
25

36
import 'package:dart_frog/dart_frog.dart';
@@ -161,7 +164,7 @@ Future<Response> _handleGet(
161164
Future<Response> _handlePost(
162165
RequestContext context,
163166
String modelName,
164-
ModelConfig modelConfig,
167+
ModelConfig<dynamic> modelConfig,
165168
String requestId, // Receive requestId
166169
) async {
167170
final requestBody = await context.request.json() as Map<String, dynamic>?;

0 commit comments

Comments
 (0)