Skip to content

Commit

Permalink
Merge pull request #934 from Workiva/clean-up-dep-ranges
Browse files Browse the repository at this point in the history
FED-2979 Clean up dependency ranges, clean out the lint trap
  • Loading branch information
rmconsole6-wk authored Aug 9, 2024
2 parents 05854b5 + 120faa4 commit e64a1ca
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 53 deletions.
6 changes: 6 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ analyzer:
- tools/analyzer_plugin/**
- ddc_precompiled/**
errors:
duplicate_import: warning
must_call_super: error
unused_import: warning
unnecessary_import: warning
unnecessary_null_comparison: warning

# Workaround for https://github.com/dart-lang/sdk/issues/51087
# TODO remove once we're no longer running CI on Dart 2.18
part_of_different_library: ignore
Expand Down
1 change: 0 additions & 1 deletion example/suspense/lazy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'dart:js';
import 'dart:js_util';

import 'package:js/js.dart';
Expand Down
6 changes: 2 additions & 4 deletions lib/src/builder/codegen/accessors_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,11 @@ abstract class TypedMapAccessorsGenerator extends BoilerplateDeclarationGenerato
metadataSrc.writeln(' ${annotation.toSource()}');
}

const omitTypesInOverrides = false;

final getterTypeString = omitTypesInOverrides ? '' : typeString;
final getterTypeString = typeString;
final setterTypeString =
// This change is attempting to help with null safe migration when generated code is available in legacy components
field.covariantKeyword == null
? (omitTypesInOverrides ? '' : typeString)
? getterTypeString
: '${field.covariantKeyword} $typeString';

// Carry over the existing doc comment since IDEs don't inherit
Expand Down
1 change: 0 additions & 1 deletion lib/src/builder/parsing/ast_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/syntactic_entity.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:collection/collection.dart' show IterableExtension;
import 'package:over_react/src/builder/codegen/names.dart';
import 'package:source_span/source_span.dart';
import 'package:transformer_utils/transformer_utils.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/builder/parsing/member_association.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import 'ast_util.dart';
import 'members.dart';
import 'package:collection/collection.dart' show IterableExtension;
import 'util.dart';

/// Removes the generated prefix from anywhere inside of [name].
Expand Down
7 changes: 0 additions & 7 deletions lib/src/builder/parsing/members.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:build/build.dart' show log;
import 'package:collection/collection.dart' show IterableExtension;
import 'package:meta/meta.dart';
import 'package:over_react/src/builder/codegen/names.dart';
import 'package:over_react/src/component_declaration/annotations.dart' as annotations;
Expand All @@ -24,12 +23,6 @@ import 'package:over_react/src/util/string_util.dart';

import '../parsing.dart';
import '../util.dart';
import 'ast_util.dart';
import 'declarations.dart';
import 'members_from_ast.dart';
import 'meta.dart';
import 'error_collection.dart';
import 'version.dart';

part 'members/component.dart';
part 'members/factory.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/builder/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'dart:mirrors';

import 'package:analyzer/dart/ast/ast.dart';
import 'package:build/build.dart' show AssetId;
import 'package:collection/collection.dart' show IterableExtension;
import 'package:over_react/src/builder/parsing.dart';
import 'package:path/path.dart' as p;
import 'package:source_span/source_span.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/component/_deprecated/abstract_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import 'package:meta/meta.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/component_base.dart' as component_base;

import '../abstract_transition.dart' show TransitionPhase;
export '../abstract_transition.dart' show TransitionPhase;

part 'abstract_transition.over_react.g.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/component/prop_typedefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ library over_react.prop_typedefs;

import 'package:over_react/over_react.dart';
import 'package:over_react/src/component_declaration/component_base.dart' as component_base;
import 'package:react/react_client.dart';

/// A custom rendering prop typedef that allows a custom rendering function to be provided
/// with the current [props] and [state] of the [component].
Expand Down
17 changes: 8 additions & 9 deletions lib/src/over_react_redux/over_react_flux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'dart:html';
import 'package:meta/meta.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/over_react_redux.dart';
import 'package:over_react/src/util/equality.dart';
import 'package:redux/redux.dart' as redux;
import 'package:w_flux/w_flux.dart' as flux;

Expand Down Expand Up @@ -521,8 +520,8 @@ UiFactory<TProps> Function(UiFactory<TProps>)
final originalMapStateToProps = mapStateToProps;
Map wrappedMapStateToProps(TStore state) {
return {
...originalMapStateToProps!(state),
...mapActionsToProps!(actionsForStore[state] as TActions),
...originalMapStateToProps(state),
...mapActionsToProps(actionsForStore[state] as TActions),
};
}

Expand All @@ -533,7 +532,7 @@ UiFactory<TProps> Function(UiFactory<TProps>)
if (case4) {
mapStateToProps = (state) {
return {
...mapActionsToProps!(actionsForStore[state] as TActions),
...mapActionsToProps(actionsForStore[state] as TActions),
};
};
}
Expand All @@ -543,8 +542,8 @@ UiFactory<TProps> Function(UiFactory<TProps>)
final originalMapStateWithOwnProps = mapStateToPropsWithOwnProps;
Map wrappedMapStateWithOwnProps(TStore state, TProps ownProps) {
return {
...originalMapStateWithOwnProps!(state, ownProps),
...mapActionsToPropsWithOwnProps!(
...originalMapStateWithOwnProps(state, ownProps),
...mapActionsToPropsWithOwnProps(
actionsForStore[state] as TActions, ownProps),
};
}
Expand All @@ -556,7 +555,7 @@ UiFactory<TProps> Function(UiFactory<TProps>)
if (case6) {
mapStateToPropsWithOwnProps = (state, ownProps) {
return {
...mapActionsToPropsWithOwnProps!(
...mapActionsToPropsWithOwnProps(
actionsForStore[state] as TActions, ownProps),
};
};
Expand All @@ -570,7 +569,7 @@ UiFactory<TProps> Function(UiFactory<TProps>)
mapStateToPropsWithOwnProps = (state, ownProps) {
return {
...newMapStateToProps!(state),
...mapActionsToPropsWithOwnProps!(
...mapActionsToPropsWithOwnProps(
actionsForStore[state] as TActions, ownProps),
};
};
Expand All @@ -586,7 +585,7 @@ UiFactory<TProps> Function(UiFactory<TProps>)
Map wrappedMapStateToPropsWithOwnProps(TStore state, TProps ownProps) {
return {
...originalMapStateWithOwnProps!(state, ownProps),
...mapActionsToProps!(actionsForStore[state] as TActions),
...mapActionsToProps(actionsForStore[state] as TActions),
};
}

Expand Down
1 change: 0 additions & 1 deletion lib/src/util/promise_interop.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@JS()
library over_react.promise_interop;
import 'dart:js';

import 'package:js/js.dart';

Expand Down
1 change: 0 additions & 1 deletion lib/src/util/react_wrappers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import 'package:over_react/over_react.dart';
import 'package:over_react/src/component_declaration/component_type_checking.dart';
import 'package:react/react.dart' as react;
import 'package:react/react_client.dart';
import 'package:react/react_client/js_backed_map.dart';
import 'package:react/react_client/js_interop_helpers.dart' show jsifyAndAllowInterop;
import 'package:react/react_client/react_interop.dart' hide createRef;
import 'package:react/react_dom.dart' as react_dom;
Expand Down
1 change: 0 additions & 1 deletion lib/src/util/rem_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import 'package:meta/meta.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/components.dart' as v2;
import 'package:over_react/src/component_declaration/component_base.dart' as component_base;
import 'package:over_react/src/util/css_value_util.dart';
import 'package:over_react/react_dom.dart' as react_dom;
import 'package:platform_detect/platform_detect.dart';

Expand Down
18 changes: 9 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ version: 5.2.0
description: A library for building statically-typed React UI components using Dart.
homepage: https://github.com/Workiva/over_react/
environment:
sdk: '>=2.13.0 <3.0.0'
sdk: '>=2.19.0 <3.0.0'

dependencies:
collection: ^1.15.0
analyzer: ^5.13.0
build: '>=1.0.0 <3.0.0'
build: ^2.0.0
dart_style: ^2.0.0
js: ^0.6.1+1
logging: ^1.0.0
meta: ^1.6.0
package_config: ^2.1.0
path: ^1.5.1
react: ^7.0.0
redux: '>=5.0.0 <6.0.0'
react: ^7.1.0
redux: ^5.0.0
source_span: ^1.4.1
transformer_utils: ^0.2.6
w_common: ^3.0.0
w_flux: ^3.0.0
platform_detect: '>=1.3.4 <3.0.0'
quiver: ">=0.25.0 <4.0.0"
redux_dev_tools: '>=0.4.0 <0.8.0'
platform_detect: ^2.0.0
quiver: ^3.0.0
redux_dev_tools: '>=0.6.0 <0.8.0'

dev_dependencies:
benchmark_harness: ^2.2.1
build_resolvers: '>=1.0.5 <3.0.0'
build_resolvers: ^2.0.0
build_runner: ^2.0.0
build_test: ^2.0.0
build_web_compilers: ^3.0.0
built_value_generator: ^8.0.0
dart_dev: ^4.0.1
dependency_validator: ^3.0.0
glob: ^2.0.1
io: '>=0.3.2+1 <2.0.0'
io: ^1.0.0
react_testing_library: ^3.0.1
over_react_test: ^3.0.0
pedantic: ^1.11.1
Expand Down
1 change: 0 additions & 1 deletion test/over_react/component/element_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ library element_type_test;

import 'package:test/test.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/src/component/dom_components.dart';

part 'element_type_test.over_react.g.dart'; // ignore: uri_has_not_been_generated

Expand Down
1 change: 0 additions & 1 deletion test/over_react/component/memo_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

library memo_test;

import 'package:over_react/src/util/memo.dart';
import 'package:over_react_test/over_react_test.dart';
import 'package:test/test.dart';
import 'package:over_react/over_react.dart';
Expand Down
1 change: 0 additions & 1 deletion test/over_react/component/ref_util_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'dart:js_util';
import 'package:meta/meta.dart';
import 'package:test/test.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/src/component/dom_components.dart';

import '../../test_util/test_util.dart';
import '../component/fixtures/basic_child_component.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// ignore_for_file: unnecessary_question_mark
@TestOn('browser')
library over_react.test.component2.null_safe_accessor_integration_test;

Expand Down Expand Up @@ -396,7 +397,6 @@ class _$NullSafeTestProps extends UiProps {
String? nullable;
dynamic nullableDynamic;

// ignore: unnecessary_question_mark
dynamic? nullableDynamicWithQuestion;
NullableTypedef nullableTypedefWithoutQuestion;
}
Expand All @@ -412,7 +412,6 @@ class _$NullSafeTestState extends UiState {
String? nullable;
dynamic nullableDynamic;

// ignore: unnecessary_question_mark
dynamic? nullableDynamicWithQuestion;
NullableTypedef nullableTypedefWithoutQuestion;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import 'dart:html';
import 'package:js/js_util.dart';
import 'package:over_react/over_react.dart' show Dom, DummyComponent, DummyComponent2, JsBackedMap, UiComponent2, UiStatefulComponent2, ValidationUtil, domProps, registerComponent2;
import 'package:over_react/over_react.dart' as over_react;
import 'package:over_react_test/over_react_test.dart';
import 'package:over_react/src/component_declaration/component_base.dart';
import 'package:over_react/src/component_declaration/component_type_checking.dart';
import 'package:pedantic/pedantic.dart';
Expand Down
1 change: 0 additions & 1 deletion test/over_react/util/prop_key_util_test_dart2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import 'package:test/test.dart';
import 'package:over_react/over_react.dart';
import 'package:over_react/src/util/prop_key_util.dart';

part 'prop_key_util_test_dart2.over_react.g.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import 'dart:html';

import 'package:react/react.dart' as react;
import 'package:over_react/over_react.dart';
import 'package:over_react/src/util/safe_render_manager/safe_render_manager.dart';
import 'package:over_react_test/over_react_test.dart';
import 'package:test/test.dart';
import 'package:w_common/disposable.dart';
Expand Down
2 changes: 1 addition & 1 deletion test/over_react_redux/fixtures/counter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CounterComponent extends UiComponent2<CounterProps> {
..onClick = (_) {
if (props.increment != null) {
props.increment!();
} else if (props.dispatch != null) {
} else {
props.dispatch(IncrementAction());
}
}
Expand Down
3 changes: 0 additions & 3 deletions test/vm_tests/builder/declaration_parsing_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ library declaration_parsing_test;
import 'package:analyzer/dart/analysis/utilities.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:build_test/build_test.dart' show recordLogs;
import 'package:collection/collection.dart' show IterableExtension;
import 'package:logging/logging.dart';
import 'package:meta/meta.dart';
import 'package:mocktail/mocktail.dart';
import 'package:over_react/src/builder/parsing.dart';
import 'package:over_react/src/builder/parsing/member_association.dart';
import 'package:over_react/src/builder/parsing/error_collection.dart';
import 'package:over_react/src/component_declaration/annotations.dart' as annotations;
import 'package:source_span/source_span.dart';
import 'package:test/test.dart';
Expand Down
2 changes: 1 addition & 1 deletion test/vm_tests/builder/parsing/member_association_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

@TestOn('vm')
import 'package:over_react/src/builder/parsing/member_association.dart';

import 'package:over_react/src/builder/parsing.dart';
import 'package:test/test.dart';

Expand Down
1 change: 0 additions & 1 deletion web/component2/src/demos/custom_error_boundary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

// ignore_for_file: deprecated_member_use_from_same_package
import 'package:over_react/over_react.dart';
import 'package:react/react_client/react_interop.dart';

part 'custom_error_boundary.over_react.g.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import 'package:over_react/over_react.dart';
import 'package:over_react/over_react_flux.dart';
import 'package:over_react/over_react_redux.dart';
import 'package:over_react/src/util/hoc.dart';

import '../store.dart';
import '../../../components/little_block.dart';
Expand Down

0 comments on commit e64a1ca

Please sign in to comment.