Update typedef syntax to use Function notation and turn on lint for old notation. (#18362)

Now that Dart 1 is turned off, reapplying my change to turn on the prefer_generic_function_type_aliases analysis option, and fix all the typedefs to Dart 2 preferred syntax.

Also eliminated the unused analysis_options_repo.yaml file and turned on public_member_api_docs in analysys_options.yaml.

No logic changes, just changing the typedef syntax for all typedefs, and updating analysis options.
This commit is contained in:
Greg Spencer
2018-06-11 15:51:45 -07:00
committed by GitHub
parent 3019ad976d
commit 6c56bb2420
130 changed files with 216 additions and 371 deletions

View File

@@ -20,7 +20,7 @@ const Duration _kDefaultTaskTimeout = const Duration(minutes: 15);
/// Represents a unit of work performed in the CI environment that can
/// succeed, fail and be retried independently of others.
typedef Future<TaskResult> TaskFunction();
typedef TaskFunction = Future<TaskResult> Function();
bool _isTaskRegistered = false;

View File

@@ -15,7 +15,7 @@ const int _kRunsPerBenchmark = 3;
/// Runs a benchmark once and reports the result as a lower-is-better numeric
/// value.
typedef Future<double> _Benchmark();
typedef _Benchmark = Future<double> Function();
/// Path to the generated "mega gallery" app.
Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery'));

View File

@@ -112,7 +112,7 @@ CommandArgs cmd({
);
}
typedef dynamic ExitErrorFactory();
typedef ExitErrorFactory = dynamic Function();
class CommandArgs {
CommandArgs({ this.command, this.arguments, this.environment });