Skip to content

Commit

Permalink
Fix some lints
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Nov 15, 2023
1 parent 363dade commit 23904de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/src/builder/codegen/component_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ abstract class ComponentGenerator extends BoilerplateDeclarationGenerator {
factory ComponentGenerator.legacy(LegacyClassComponentDeclaration declaration, {required bool nullSafety}) =
_LegacyComponentGenerator;

late TypedMapNames propsNames;
TypedMapNames? stateNames;
late ComponentNames componentNames;
late FactoryNames factoryNames;
TypedMapNames get propsNames;
TypedMapNames? get stateNames;
ComponentNames get componentNames;
FactoryNames get factoryNames;

BoilerplateComponent get component;
bool get hasState;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/builder/parsing/member_association.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,8 @@ String? getRelatedName(BoilerplateMember member) {
}

extension<T> on T? {
S? mapIfNotNull<S>(S? Function(T) callback) => this == null ? null : callback(this!);
S? mapIfNotNull<S>(S? Function(T) callback) {
final self = this;
return self == null ? null : callback(self);
}
}
2 changes: 1 addition & 1 deletion lib/src/builder/parsing/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class InstantiatedComponentMeta<TMeta> extends InstantiatedMeta<TMeta> {
subtypeOfValue = expression;
instantiated.unsupportedArguments.remove(subtypeOfParam);
} else {
throw '`$_subtypeOfParamName` must be an identifier: $subtypeOfParam';
throw Exception('`$_subtypeOfParamName` must be an identifier: $subtypeOfParam');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/component_declaration/builder_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ abstract class UiProps extends component_base.UiProps with GeneratedClass {
}
}

class MissingRequiredPropsError {
class MissingRequiredPropsError extends Error {
final String _message;

MissingRequiredPropsError(this._message);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/util/prop_key_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _SingleKeyAccessMapSpy extends MapBase {
}

// FIXME document, add test cases (especially for non-nullable props).
class KeyAccessedException {
class KeyAccessedException implements Exception {
final Object? key;

KeyAccessedException(this.key);
Expand Down

0 comments on commit 23904de

Please sign in to comment.