[dartdevc] Apply lints and cleanup violations

- always_require_non_null_named_parameters
- prefer_final_fields

Change-Id: I21dc5a9514fe2a7bb09c91fe28b2d4b79d7991e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133840
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This commit is contained in:
Nicholas Shahan 2020-01-31 00:47:26 +00:00 committed by commit-bot@chromium.org
parent 26fec2ef66
commit 40e816b456
6 changed files with 11 additions and 8 deletions

View file

@ -17,12 +17,14 @@ linter:
rules:
# Enforced by pedantic v1.9.0.
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_null_checks_in_equality_operators
- camel_case_extensions
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_final_fields
- prefer_for_elements_to_map_fromIterable
- prefer_if_null_operators
- prefer_single_quotes
@ -30,4 +32,4 @@ linter:
# Not enforced by pedantic at any version.
- directives_ordering
- prefer_null_aware_operators
- prefer_typing_uninitialized_variables
- prefer_typing_uninitialized_variables

View file

@ -3,7 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: slash_for_doc_comments, prefer_single_quotes
// ignore_for_file: always_declare_return_types
// ignore_for_file: always_declare_return_types, prefer_final_fields
// ignore_for_file: always_require_non_null_named_parameters
part of js_ast;

View file

@ -4,7 +4,7 @@
// ignore_for_file: slash_for_doc_comments, unnecessary_const
// ignore_for_file: always_declare_return_types, prefer_single_quotes
// ignore_for_file: prefer_collection_literals
// ignore_for_file: prefer_collection_literals, prefer_final_fields
part of js_ast;

View file

@ -2298,7 +2298,7 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
return _extensionTypes.isNativeInterface(c);
}
var _forwardingCache = HashMap<Class, Map<String, Member>>();
final _forwardingCache = HashMap<Class, Map<String, Member>>();
Member _lookupForwardedMember(Class c, String name) {
// We only care about public methods.

View file

@ -22,8 +22,8 @@ import 'kernel_helpers.dart';
class DevCompilerTarget extends Target {
// TODO(39698) Turn these back into const lists returned from the getters
// once we don't have to exclude libraries from the forked NNBD sdk.
List<String> _extraRequiredLibraries;
List<String> _extraIndexedLibraries;
final List<String> _extraRequiredLibraries;
final List<String> _extraIndexedLibraries;
DevCompilerTarget(this.flags)
: _extraRequiredLibraries = [

View file

@ -60,8 +60,8 @@ external String _stringify(dynamic json);
/// The unparsed data for the source maps must still be loaded before
/// LazyMapping is used.
class LazyMapping extends Mapping {
MappingBundle _bundle = MappingBundle();
SourceMapProvider _provider;
final MappingBundle _bundle = MappingBundle();
final SourceMapProvider _provider;
LazyMapping(this._provider);