Skip to content

Commit

Permalink
Convert playground to workiva_analysis_options and new boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Jun 15, 2020
1 parent 5e6f9ae commit 7ccf395
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 82 deletions.
27 changes: 2 additions & 25 deletions playground/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include: package:workiva_analysis_options/v1.yaml

analyzer:
strong-mode: true
plugins:
Expand All @@ -6,28 +8,3 @@ analyzer:
plugins:
over_react_analyzer_plugin_host:
enabled: true

linter:
rules:
- annotate_overrides
- avoid_as
- avoid_empty_else
- avoid_init_to_null
- avoid_return_types_on_setters
- camel_case_types
- cancel_subscriptions
- close_sinks
- empty_constructor_bodies
- hash_and_equals
- library_names
- library_prefixes
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- slash_for_doc_comments
- sort_constructors_first
- sort_unnamed_constructors_first
- type_init_formals
- unnecessary_brace_in_string_interps
- unnecessary_getters_setters
5 changes: 3 additions & 2 deletions playground/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: plugin_playground
version: 0.0.0
environment:
sdk: '>=2.4.0 <3.0.0'
sdk: '>=2.7.0 <3.0.0'
dependencies:
over_react: ^3.0.0
over_react: ^3.5.3
dev_dependencies:
over_react_analyzer_plugin_host:
path: ../plugin_hosts/path
build_runner: ^1.0.0
build_web_compilers: ^2.0.0
workiva_analysis_options: ^1.1.0
16 changes: 3 additions & 13 deletions playground/web/bool_prop_readability.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import 'package:over_react/over_react.dart';

part 'bool_prop_readability.over_react.g.dart';

@Factory()
// ignore: undefined_identifier
UiFactory<BarProps> Bar = _$Bar;
UiFactory<BarProps> Bar = _$Bar; // ignore: undefined_identifier

@Props()
class _$BarProps extends UiProps {
mixin BarProps on UiProps {
// Prefix
bool isGoodPrefix;
bool wasGoodPrefix;
Expand Down Expand Up @@ -41,14 +38,7 @@ class _$BarProps extends UiProps {
bool jumpAround; // Better Option: canJumpAround or enableJumpAround
}

// ignore: mixin_of_non_class, undefined_class
class BarProps extends _$BarProps with _$BarPropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaForBarProps;
}

@Component()
class BarComponent extends UiComponent<BarProps> {
class BarComponent extends UiComponent2<BarProps> {
@override
render() => Dom.div()();
}
17 changes: 3 additions & 14 deletions playground/web/component_render.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import 'package:over_react/over_react.dart';

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

@Factory()
// ignore: undefined_identifier
UiFactory<BadRenderProps> BadRender = _$BadRender;
UiFactory<BadRenderProps> BadRender = _$BadRender; // ignore: undefined_identifier

@Props()
class _$BadRenderProps extends UiProps {}
mixin BadRenderProps on UiProps {}

// ignore: mixin_of_non_class, undefined_class
class BadRenderProps extends _$BadRenderProps with _$BadRenderPropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaForBadRenderProps;
}

@Component()
class BadRenderComponent extends UiComponent<BadRenderProps> {
class BadRenderComponent extends UiComponent2<BadRenderProps> {
@override
render() {
if (props.id == 'something') {
Expand Down
1 change: 0 additions & 1 deletion playground/web/extract_component.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:over_react/over_react.dart';

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

ReactElement renderTheFoo() {
Expand Down
16 changes: 3 additions & 13 deletions playground/web/foo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@ import 'package:over_react/over_react.dart';

part 'foo.over_react.g.dart';

@Factory()
// ignore: undefined_identifier
UiFactory<FooProps> Foo = _$Foo;
UiFactory<FooProps> Foo = _$Foo; // ignore: undefined_identifier

@Props()
class _$FooProps extends UiProps {}
mixin FooProps on UiProps {}

// ignore: mixin_of_non_class, undefined_class
class FooProps extends _$FooProps with _$FooPropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaForFooProps;
}

@Component()
class FooComponent extends UiComponent<FooProps> {
class FooComponent extends UiComponent2<FooProps> {
@override
render() {}
}
17 changes: 3 additions & 14 deletions playground/web/missing_required_props.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,17 @@ main() {
)();
}

UiFactory<BarProps> Bar = _$Bar; // ignore: undefined_identifier

@Factory()
// ignore: undefined_identifier
UiFactory<BarProps> Bar = _$Bar;

@Props()
class _$BarProps extends UiProps {
mixin BarProps on UiProps {
@requiredProp
String barRequired;

/// yo yo
String bar;
}

// ignore: mixin_of_non_class, undefined_class
class BarProps extends _$BarProps with _$BarPropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaForBarProps;
}

@Component()
class BarComponent extends UiComponent<BarProps> {
class BarComponent extends UiComponent2<BarProps> {
@override
render() => Dom.div()();
}

0 comments on commit 7ccf395

Please sign in to comment.