Version 3.10.0-85.0.dev
Merge 4a8e2b49cd947279591cfb08bdef3f3901585f6f into dev
diff --git a/DEPS b/DEPS
index bb7fff7..31747b2 100644
--- a/DEPS
+++ b/DEPS
@@ -142,7 +142,7 @@
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
"native_rev": "16ae2d8619e23fc2bd83fbff087a26ac032a1145", # rolled manually while native assets are experimental
"protobuf_rev": "0b73b0d64c15e34d35f6e5f9036aac52e4a64033",
- "pub_rev": "c3e50919d11896f014cb971e1776d00a0e2d18b3", # rolled manually
+ "pub_rev": "619db737b4aba0a43beaf16ffa141ee70d7bbd9e", # rolled manually
"shelf_rev": "2a46b4ffe1f095909c3b14bdf62da40cbdbd82e9",
"sync_http_rev": "c07f96f89a7eec7e3daac641fa6c587224fcfbaa",
"tar_rev": "5a1ea943e70cdf3fa5e1102cdbb9418bd9b4b81a",
diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart
index 37044af..6737b65 100644
--- a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart
@@ -41,21 +41,25 @@
"Illegal character '{0}'.",
);
+ /// No parameters.
static const ScannerErrorCode MISSING_DIGIT = const ScannerErrorCode(
'MISSING_DIGIT',
"Decimal digit expected.",
);
+ /// No parameters.
static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode(
'MISSING_HEX_DIGIT',
"Hexadecimal digit expected.",
);
+ /// No parameters.
static const ScannerErrorCode MISSING_IDENTIFIER = const ScannerErrorCode(
'MISSING_IDENTIFIER',
"Expected an identifier.",
);
+ /// No parameters.
static const ScannerErrorCode MISSING_QUOTE = const ScannerErrorCode(
'MISSING_QUOTE',
"Expected quote (' or \").",
@@ -68,6 +72,7 @@
"Unable to get content of '{0}'.",
);
+ /// No parameters.
static const ScannerErrorCode
UNEXPECTED_DOLLAR_IN_STRING = const ScannerErrorCode(
'UNEXPECTED_DOLLAR_IN_STRING',
@@ -76,6 +81,7 @@
correctionMessage: "Try adding a backslash (\\) to escape the '\$'.",
);
+ /// No parameters.
static const ScannerErrorCode
UNEXPECTED_SEPARATOR_IN_NUMBER = const ScannerErrorCode(
'UNEXPECTED_SEPARATOR_IN_NUMBER',
@@ -91,6 +97,7 @@
"The '{0}' operator is not supported.",
);
+ /// No parameters.
static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT =
const ScannerErrorCode(
'UNTERMINATED_MULTI_LINE_COMMENT',
@@ -100,6 +107,7 @@
"occurrences of '/*' (because comments nest in Dart).",
);
+ /// No parameters.
static const ScannerErrorCode UNTERMINATED_STRING_LITERAL =
const ScannerErrorCode(
'UNTERMINATED_STRING_LITERAL',
diff --git a/pkg/analyzer/api.txt b/pkg/analyzer/api.txt
index d6a383f..f353dc3 100644
--- a/pkg/analyzer/api.txt
+++ b/pkg/analyzer/api.txt
@@ -4434,7 +4434,7 @@
acceptWithArgument (method: R Function<R, A>(TypeVisitorWithArgument<R, A>, A))
asInstanceOf (method: InterfaceType? Function(InterfaceElement), experimental)
asInstanceOf2 (method: InterfaceType? Function(InterfaceElement), deprecated, experimental)
- getDisplayString (method: String Function({bool withNullability}))
+ getDisplayString (method: String Function({deprecated bool withNullability}))
DynamicType (class extends Object implements DartType):
new (constructor: DynamicType Function())
FunctionType (class extends Object implements DartType):
@@ -4763,8 +4763,8 @@
buildSdkSummary (function: Future<Uint8List> Function({String? embedderYamlPath, required ResourceProvider resourceProvider, required String sdkPath}))
package:analyzer/diagnostic/diagnostic.dart:
Diagnostic (class extends Object):
- forValues (constructor: Diagnostic Function({List<DiagnosticMessage> contextMessages, String? correctionMessage, Object? data, DiagnosticCode? diagnosticCode, DiagnosticCode? errorCode, required int length, required String message, required int offset, required Source source}))
- tmp (constructor: Diagnostic Function({List<Object?> arguments, List<DiagnosticMessage> contextMessages, Object? data, DiagnosticCode? diagnosticCode, DiagnosticCode? errorCode, required int length, required int offset, required Source source}))
+ forValues (constructor: Diagnostic Function({List<DiagnosticMessage> contextMessages, String? correctionMessage, Object? data, DiagnosticCode? diagnosticCode, deprecated DiagnosticCode? errorCode, required int length, required String message, required int offset, required Source source}))
+ tmp (constructor: Diagnostic Function({List<Object?> arguments, List<DiagnosticMessage> contextMessages, Object? data, DiagnosticCode? diagnosticCode, deprecated DiagnosticCode? errorCode, required int length, required int offset, required Source source}))
contextMessages (getter: List<DiagnosticMessage>)
correction (getter: String?, deprecated)
correctionMessage (getter: String?)
@@ -4878,7 +4878,7 @@
atElement2 (method: void Function(Element, DiagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}), experimental)
atEntity (method: void Function(SyntacticEntity, DiagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
atNode (method: void Function(AstNode, DiagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
- atOffset (method: void Function({List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data, DiagnosticCode? diagnosticCode, DiagnosticCode? errorCode, required int length, required int offset}))
+ atOffset (method: void Function({List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data, DiagnosticCode? diagnosticCode, deprecated DiagnosticCode? errorCode, required int length, required int offset}))
atSourceSpan (method: void Function(SourceSpan, DiagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
atToken (method: void Function(Token, DiagnosticCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
reportError (method: void Function(Diagnostic))
diff --git a/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart b/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
index 934be6c..730836c 100644
--- a/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
+++ b/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
@@ -76,7 +76,6 @@
///
/// Parameters:
/// 0: the option name
- ///
static const AnalysisOptionsWarningCode ANALYSIS_OPTION_DEPRECATED =
AnalysisOptionsWarningCode(
'ANALYSIS_OPTION_DEPRECATED',
diff --git a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
index 4bbe080..e4d814e 100644
--- a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
+++ b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
@@ -105,7 +105,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode ARGUMENT_MUST_BE_NATIVE = FfiCode(
'ARGUMENT_MUST_BE_NATIVE',
"Argument to 'Native.addressOf' must be annotated with @Native",
@@ -161,7 +161,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET = FfiCode(
'FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET',
"There may be at most one @DefaultAsset annotation on a library.",
@@ -169,7 +169,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS = FfiCode(
'FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS',
"Native functions and fields must have exactly one `@Native` annotation.",
@@ -373,7 +373,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode NATIVE_FIELD_MISSING_TYPE = FfiCode(
'NATIVE_FIELD_MISSING_TYPE',
"The native type of this field could not be inferred and must be specified "
@@ -384,7 +384,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode NATIVE_FIELD_NOT_STATIC = FfiCode(
'NATIVE_FIELD_NOT_STATIC',
"Native fields must be static.",
@@ -392,7 +392,7 @@
hasPublishedDocs: true,
);
- /// No parameters
+ /// No parameters.
static const FfiCode NATIVE_FUNCTION_MISSING_TYPE = FfiCode(
'NATIVE_FUNCTION_MISSING_TYPE',
"The native type of this function couldn't be inferred so it must be "
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart
index b96c599..39f4526 100644
--- a/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart
@@ -27,10 +27,10 @@
import "package:_fe_analyzer_shared/src/base/errors.dart";
class HintCode extends DiagnosticCode {
- /// No parameters.
- ///
/// Note: Since this diagnostic is only produced in pre-3.0 code, we do not
/// plan to go through the exercise of converting it to a Warning.
+ ///
+ /// No parameters.
static const HintCode DEPRECATED_COLON_FOR_DEFAULT_VALUE = HintCode(
'DEPRECATED_COLON_FOR_DEFAULT_VALUE',
"Using a colon as the separator before a default value is deprecated and "
@@ -49,11 +49,11 @@
hasPublishedDocs: true,
);
- /// Parameters:
- /// 0: the name of the member
- ///
/// This code is deprecated in favor of the
/// 'deprecated_member_from_same_package' lint rule, and will be removed.
+ ///
+ /// Parameters:
+ /// 0: the name of the member
static const HintCode DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE = HintCode(
'DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE',
"'{0}' is deprecated and shouldn't be used.",
@@ -62,12 +62,12 @@
hasPublishedDocs: true,
);
+ /// This code is deprecated in favor of the
+ /// 'deprecated_member_from_same_package' lint rule, and will be removed.
+ ///
/// Parameters:
/// 0: the name of the member
/// 1: message details
- ///
- /// This code is deprecated in favor of the
- /// 'deprecated_member_from_same_package' lint rule, and will be removed.
static const HintCode
DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE = HintCode(
'DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE',
diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
index 8443fdd..9ff8b3b 100644
--- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
+++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
@@ -256,6 +256,7 @@
correctionMessage: "Try removing the 'abstract' or 'static' keyword.",
);
+ /// No parameters.
static const ParserErrorCode ABSTRACT_STATIC_METHOD = ParserErrorCode(
'ABSTRACT_STATIC_METHOD',
"Static methods can't be declared to be 'abstract'.",
@@ -289,6 +290,8 @@
/// 16.32 Identifier Reference: It is a compile-time error if any of the
/// identifiers async, await, or yield is used as an identifier in a function
/// body marked with either async, async, or sync.
+ ///
+ /// No parameters.
static const ParserErrorCode ASYNC_KEYWORD_USED_AS_IDENTIFIER =
ParserErrorCode(
'ASYNC_KEYWORD_USED_AS_IDENTIFIER',
@@ -379,6 +382,7 @@
" the class' constructor(s).",
);
+ /// No parameters.
static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = ParserErrorCode(
'CONST_CONSTRUCTOR_WITH_BODY',
"Const constructors can't have a body.",
@@ -420,6 +424,7 @@
"Try removing either the 'covariant' or 'static' keyword.",
);
+ /// No parameters.
static const ParserErrorCode COVARIANT_CONSTRUCTOR = ParserErrorCode(
'COVARIANT_CONSTRUCTOR',
"A constructor can't be declared to be 'covariant'.",
@@ -489,6 +494,7 @@
correctionMessage: "Try removing all but one prefix.",
);
+ /// No parameters.
static const ParserErrorCode EMPTY_ENUM_BODY = ParserErrorCode(
'EMPTY_ENUM_BODY',
"An enum must declare at least one constant name.",
@@ -533,6 +539,7 @@
"Try putting parentheses around one of the comparisons.",
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = ParserErrorCode(
'EXPECTED_CASE_OR_DEFAULT',
"Expected 'case' or 'default'.",
@@ -553,6 +560,7 @@
uniqueName: 'EXPECTED_CLASS_BODY',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_CLASS_MEMBER = ParserErrorCode(
'EXPECTED_CLASS_MEMBER',
"Expected a class member.",
@@ -564,6 +572,7 @@
"Expected 'else' or comma.",
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_EXECUTABLE = ParserErrorCode(
'EXPECTED_EXECUTABLE',
"Expected a method, getter, setter or operator declaration.",
@@ -605,6 +614,7 @@
"Expected '{0}' instead of this.",
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = ParserErrorCode(
'EXPECTED_LIST_OR_MAP_LITERAL',
"Expected a list or map literal.",
@@ -619,6 +629,7 @@
uniqueName: 'EXPECTED_MIXIN_BODY',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_NAMED_TYPE_EXTENDS = ParserErrorCode(
'EXPECTED_NAMED_TYPE',
"Expected a class name.",
@@ -626,6 +637,7 @@
uniqueName: 'EXPECTED_NAMED_TYPE_EXTENDS',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_NAMED_TYPE_IMPLEMENTS = ParserErrorCode(
'EXPECTED_NAMED_TYPE',
"Expected the name of a class or mixin.",
@@ -634,6 +646,7 @@
uniqueName: 'EXPECTED_NAMED_TYPE_IMPLEMENTS',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_NAMED_TYPE_ON = ParserErrorCode(
'EXPECTED_NAMED_TYPE',
"Expected the name of a class or mixin.",
@@ -642,6 +655,7 @@
uniqueName: 'EXPECTED_NAMED_TYPE_ON',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_NAMED_TYPE_WITH = ParserErrorCode(
'EXPECTED_NAMED_TYPE',
"Expected a mixin name.",
@@ -649,6 +663,7 @@
uniqueName: 'EXPECTED_NAMED_TYPE_WITH',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_REPRESENTATION_FIELD = ParserErrorCode(
'EXPECTED_REPRESENTATION_FIELD',
"Expected a representation field.",
@@ -656,6 +671,7 @@
"Try providing the representation field for this extension type.",
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_REPRESENTATION_TYPE = ParserErrorCode(
'EXPECTED_REPRESENTATION_TYPE',
"Expected a representation type.",
@@ -663,6 +679,7 @@
"Try providing the representation type for this extension type.",
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_STRING_LITERAL = ParserErrorCode(
'EXPECTED_STRING_LITERAL',
"Expected a string literal.",
@@ -697,6 +714,7 @@
uniqueName: 'EXPECTED_TRY_STATEMENT_BODY',
);
+ /// No parameters.
static const ParserErrorCode EXPECTED_TYPE_NAME = ParserErrorCode(
'EXPECTED_TYPE_NAME',
"Expected a type name.",
@@ -824,6 +842,7 @@
"external getter and/or setter.",
);
+ /// No parameters.
static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = ParserErrorCode(
'EXTERNAL_GETTER_WITH_BODY',
"External getters can't have a body.",
@@ -843,6 +862,7 @@
"An external or native method can't have a body.",
);
+ /// No parameters.
static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = ParserErrorCode(
'EXTERNAL_OPERATOR_WITH_BODY',
"External operators can't have a body.",
@@ -851,6 +871,7 @@
"'external'.",
);
+ /// No parameters.
static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = ParserErrorCode(
'EXTERNAL_SETTER_WITH_BODY',
"External setters can't have a body.",
@@ -891,12 +912,14 @@
correctionMessage: "Try removing the keyword 'factory'.",
);
+ /// No parameters.
static const ParserErrorCode FACTORY_WITHOUT_BODY = ParserErrorCode(
'FACTORY_WITHOUT_BODY',
"A non-redirecting 'factory' constructor must have a body.",
correctionMessage: "Try adding a body to the constructor.",
);
+ /// No parameters.
static const ParserErrorCode FACTORY_WITH_INITIALIZERS = ParserErrorCode(
'FACTORY_WITH_INITIALIZERS',
"A 'factory' constructor can't have initializers.",
@@ -945,6 +968,7 @@
correctionMessage: "Try removing the keyword 'var'.",
);
+ /// No parameters.
static const ParserErrorCode FINAL_CONSTRUCTOR = ParserErrorCode(
'FINAL_CONSTRUCTOR',
"A constructor can't be declared to be 'final'.",
@@ -957,6 +981,7 @@
correctionMessage: "Try removing the keyword 'final'.",
);
+ /// No parameters.
static const ParserErrorCode FINAL_METHOD = ParserErrorCode(
'FINAL_METHOD',
"Getters, setters and methods can't be declared to be 'final'.",
@@ -988,6 +1013,7 @@
correctionMessage: "Try removing 'get'.",
);
+ /// No parameters.
static const ParserErrorCode GETTER_IN_FUNCTION = ParserErrorCode(
'GETTER_IN_FUNCTION',
"Getters can't be defined within methods or functions.",
@@ -996,6 +1022,7 @@
"the getter to a function.",
);
+ /// No parameters.
static const ParserErrorCode GETTER_WITH_PARAMETERS = ParserErrorCode(
'GETTER_WITH_PARAMETERS',
"Getters must be declared without a parameter list.",
@@ -1103,6 +1130,7 @@
"The escape sequence '{0}' isn't a valid code point.",
);
+ /// No parameters.
static const ParserErrorCode INVALID_COMMENT_REFERENCE = ParserErrorCode(
'INVALID_COMMENT_REFERENCE',
"Comment references should contain a possibly prefixed identifier and can "
@@ -1161,6 +1189,7 @@
"The name of a constructor must match the name of the enclosing class.",
);
+ /// No parameters.
static const ParserErrorCode INVALID_GENERIC_FUNCTION_TYPE = ParserErrorCode(
'INVALID_GENERIC_FUNCTION_TYPE',
"Invalid generic function type.",
@@ -1191,6 +1220,7 @@
"pattern in parentheses.",
);
+ /// No parameters.
static const ParserErrorCode INVALID_LITERAL_IN_CONFIGURATION =
ParserErrorCode(
'INVALID_LITERAL_IN_CONFIGURATION',
@@ -1205,11 +1235,11 @@
"The string '{0}' isn't a user-definable operator.",
);
- /// Parameters:
- /// 0: the operator being applied to 'super'
- ///
/// Only generated by the old parser.
/// Replaced by INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER.
+ ///
+ /// Parameters:
+ /// 0: the operator being applied to 'super'
static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = ParserErrorCode(
'INVALID_OPERATOR_FOR_SUPER',
"The operator '{0}' can't be used with 'super'.",
@@ -1223,6 +1253,7 @@
correctionMessage: "Try replacing '?.' with '.'",
);
+ /// No parameters.
static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = ParserErrorCode(
'INVALID_STAR_AFTER_ASYNC',
"The modifier 'async*' isn't allowed for an expression function body.",
@@ -1235,6 +1266,7 @@
"constructor (e.g. 'super()' or 'super.namedConstructor()')",
);
+ /// No parameters.
static const ParserErrorCode INVALID_SYNC = ParserErrorCode(
'INVALID_SYNC',
"The modifier 'sync' isn't allowed for an expression function body.",
@@ -1284,6 +1316,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const ParserErrorCode
INVALID_USE_OF_IDENTIFIER_AUGMENTED = ParserErrorCode(
'INVALID_USE_OF_IDENTIFIER_AUGMENTED',
@@ -1325,6 +1358,7 @@
correctionMessage: "Try removing 'new'",
);
+ /// No parameters.
static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER =
ParserErrorCode(
'LOCAL_FUNCTION_DECLARATION_MODIFIER',
@@ -1360,6 +1394,7 @@
"statement.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = ParserErrorCode(
'MISSING_CLOSING_PARENTHESIS',
"The closing parenthesis is missing.",
@@ -1375,12 +1410,14 @@
"Try adding the name of the type of the variable or the keyword 'var'.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_ENUM_BODY = ParserErrorCode(
'MISSING_ENUM_BODY',
"An enum definition must have a body with at least one constant name.",
correctionMessage: "Try adding a body and defining at least one constant.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER =
ParserErrorCode(
'MISSING_EXPRESSION_IN_INITIALIZER',
@@ -1398,12 +1435,14 @@
"exception",
);
+ /// No parameters.
static const ParserErrorCode MISSING_FUNCTION_BODY = ParserErrorCode(
'MISSING_FUNCTION_BODY',
"A function body must be provided.",
correctionMessage: "Try adding a function body.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_FUNCTION_KEYWORD = ParserErrorCode(
'MISSING_FUNCTION_KEYWORD',
"Function types must have the keyword 'Function' before the parameter "
@@ -1411,18 +1450,21 @@
correctionMessage: "Try adding the keyword 'Function'.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = ParserErrorCode(
'MISSING_FUNCTION_PARAMETERS',
"Functions must have an explicit list of parameters.",
correctionMessage: "Try adding a parameter list.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_GET = ParserErrorCode(
'MISSING_GET',
"Getters must have the keyword 'get' before the getter name.",
correctionMessage: "Try adding the keyword 'get'.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_IDENTIFIER = ParserErrorCode(
'MISSING_IDENTIFIER',
"Expected an identifier.",
@@ -1439,12 +1481,14 @@
correctionMessage: "Try adding the keyword 'operator'.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_METHOD_PARAMETERS = ParserErrorCode(
'MISSING_METHOD_PARAMETERS',
"Methods must have an explicit list of parameters.",
correctionMessage: "Try adding a parameter list.",
);
+ /// No parameters.
static const ParserErrorCode
MISSING_NAME_FOR_NAMED_PARAMETER = ParserErrorCode(
'MISSING_NAME_FOR_NAMED_PARAMETER',
@@ -1453,6 +1497,7 @@
"Try providing a name for the parameter or removing the curly braces.",
);
+ /// No parameters.
static const ParserErrorCode
MISSING_NAME_IN_LIBRARY_DIRECTIVE = ParserErrorCode(
'MISSING_NAME_IN_LIBRARY_DIRECTIVE',
@@ -1462,6 +1507,7 @@
"library directive if the library doesn't have any parts.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE =
ParserErrorCode(
'MISSING_NAME_IN_PART_OF_DIRECTIVE',
@@ -1493,6 +1539,7 @@
"Try adding formal parameters after the primary constructor name.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_STAR_AFTER_SYNC = ParserErrorCode(
'MISSING_STAR_AFTER_SYNC',
"The modifier 'sync' must be followed by a star ('*').",
@@ -1513,12 +1560,14 @@
correctionMessage: "Try inserting a '{0}' at the end of the group.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = ParserErrorCode(
'MISSING_TYPEDEF_PARAMETERS',
"Typedefs must have an explicit list of parameters.",
correctionMessage: "Try adding a parameter list.",
);
+ /// No parameters.
static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = ParserErrorCode(
'MISSING_VARIABLE_IN_FOR_EACH',
"A loop variable must be declared in a for-each loop before the 'in', but "
@@ -1526,6 +1575,7 @@
correctionMessage: "Try declaring a loop variable.",
);
+ /// No parameters.
static const ParserErrorCode MIXED_PARAMETER_GROUPS = ParserErrorCode(
'MIXED_PARAMETER_GROUPS',
"Can't have both positional and named parameters in a single parameter "
@@ -1564,6 +1614,7 @@
"mix in) the others.",
);
+ /// No parameters.
static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = ParserErrorCode(
'MULTIPLE_IMPLEMENTS_CLAUSES',
"Each class or mixin definition can have at most one implements clause.",
@@ -1577,6 +1628,7 @@
correctionMessage: "Try removing all but one of the library directives.",
);
+ /// No parameters.
static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS =
ParserErrorCode(
'MULTIPLE_NAMED_PARAMETER_GROUPS',
@@ -1599,6 +1651,7 @@
correctionMessage: "Try removing all but one of the part-of directives.",
);
+ /// No parameters.
static const ParserErrorCode
MULTIPLE_POSITIONAL_PARAMETER_GROUPS = ParserErrorCode(
'MULTIPLE_POSITIONAL_PARAMETER_GROUPS',
@@ -1607,6 +1660,7 @@
correctionMessage: "Try combining all of the groups into a single group.",
);
+ /// No parameters.
static const ParserErrorCode MULTIPLE_REPRESENTATION_FIELDS = ParserErrorCode(
'MULTIPLE_REPRESENTATION_FIELDS',
"Each extension type should have exactly one representation field.",
@@ -1638,6 +1692,7 @@
"Try combining all of the with clauses into a single clause.",
);
+ /// No parameters.
static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = ParserErrorCode(
'NAMED_FUNCTION_EXPRESSION',
"Function expressions can't be named.",
@@ -1646,18 +1701,21 @@
"function declaration statement.",
);
+ /// No parameters.
static const ParserErrorCode NAMED_FUNCTION_TYPE = ParserErrorCode(
'NAMED_FUNCTION_TYPE',
"Function types can't be named.",
correctionMessage: "Try replacing the name with the keyword 'Function'.",
);
+ /// No parameters.
static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = ParserErrorCode(
'NAMED_PARAMETER_OUTSIDE_GROUP',
"Named parameters must be enclosed in curly braces ('{' and '}').",
correctionMessage: "Try surrounding the named parameters in curly braces.",
);
+ /// No parameters.
static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = ParserErrorCode(
'NATIVE_CLAUSE_IN_NON_SDK_CODE',
"Native clause can only be used in the SDK and code that is loaded through "
@@ -1674,6 +1732,7 @@
"@native('native-name') before the declaration.",
);
+ /// No parameters.
static const ParserErrorCode
NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = ParserErrorCode(
'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE',
@@ -1682,18 +1741,21 @@
correctionMessage: "Try removing the word 'native'.",
);
+ /// No parameters.
static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = ParserErrorCode(
'NON_CONSTRUCTOR_FACTORY',
"Only a constructor can be declared to be a factory.",
correctionMessage: "Try removing the keyword 'factory'.",
);
+ /// No parameters.
static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = ParserErrorCode(
'NON_IDENTIFIER_LIBRARY_NAME',
"The name of a library must be an identifier.",
correctionMessage: "Try using an identifier as the name of the library.",
);
+ /// No parameters.
static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = ParserErrorCode(
'NON_PART_OF_DIRECTIVE_IN_PART',
"The part-of directive must be the only directive in a part.",
@@ -1702,6 +1764,7 @@
"which this is a part.",
);
+ /// No parameters.
static const ParserErrorCode NON_STRING_LITERAL_AS_URI = ParserErrorCode(
'NON_STRING_LITERAL_AS_URI',
"The URI must be a string literal.",
@@ -1716,6 +1779,7 @@
"The operator '{0}' isn't user definable.",
);
+ /// No parameters.
static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS =
ParserErrorCode(
'NORMAL_BEFORE_OPTIONAL_PARAMETERS',
@@ -1740,6 +1804,7 @@
correctionMessage: "Try moving the '{0}' clause before the '{1}' clause.",
);
+ /// No parameters.
static const ParserErrorCode PART_OF_NAME = ParserErrorCode(
'PART_OF_NAME',
"The 'part of' directive can't use a name with the enhanced-parts feature.",
@@ -1766,6 +1831,7 @@
"or method.",
);
+ /// No parameters.
static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT =
ParserErrorCode(
'POSITIONAL_AFTER_NAMED_ARGUMENT',
@@ -1775,6 +1841,7 @@
"arguments.",
);
+ /// No parameters.
static const ParserErrorCode
POSITIONAL_PARAMETER_OUTSIDE_GROUP = ParserErrorCode(
'POSITIONAL_PARAMETER_OUTSIDE_GROUP',
@@ -1823,12 +1890,14 @@
"Try making this a factory constructor, or remove the redirection.",
);
+ /// No parameters.
static const ParserErrorCode REPRESENTATION_FIELD_MODIFIER = ParserErrorCode(
'REPRESENTATION_FIELD_MODIFIER',
"Representation fields can't have modifiers.",
correctionMessage: "Try removing the modifier.",
);
+ /// No parameters.
static const ParserErrorCode REPRESENTATION_FIELD_TRAILING_COMMA =
ParserErrorCode(
'REPRESENTATION_FIELD_TRAILING_COMMA',
@@ -1860,6 +1929,7 @@
correctionMessage: "Try removing 'set'.",
);
+ /// No parameters.
static const ParserErrorCode SETTER_IN_FUNCTION = ParserErrorCode(
'SETTER_IN_FUNCTION',
"Setters can't be defined within methods or functions.",
@@ -1878,6 +1948,7 @@
correctionMessage: "Try removing the keyword 'static'.",
);
+ /// No parameters.
static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = ParserErrorCode(
'STATIC_GETTER_WITHOUT_BODY',
"A 'static' getter must have a body.",
@@ -1891,6 +1962,7 @@
correctionMessage: "Try removing the keyword 'static'.",
);
+ /// No parameters.
static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = ParserErrorCode(
'STATIC_SETTER_WITHOUT_BODY',
"A 'static' setter must have a body.",
@@ -1998,12 +2070,14 @@
"The keyword 'var' can't be used as a type name.",
);
+ /// No parameters.
static const ParserErrorCode VAR_CLASS = ParserErrorCode(
'VAR_CLASS',
"Classes can't be declared to be 'var'.",
correctionMessage: "Try removing the keyword 'var'.",
);
+ /// No parameters.
static const ParserErrorCode VAR_ENUM = ParserErrorCode(
'VAR_ENUM',
"Enums can't be declared to be 'var'.",
@@ -2018,6 +2092,7 @@
"return type.",
);
+ /// No parameters.
static const ParserErrorCode VAR_TYPEDEF = ParserErrorCode(
'VAR_TYPEDEF',
"Typedefs can't be declared to be 'var'.",
@@ -2038,6 +2113,7 @@
correctionMessage: "Try moving the extends clause before the with clause.",
);
+ /// No parameters.
static const ParserErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER =
ParserErrorCode(
'WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER',
@@ -2045,6 +2121,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const ParserErrorCode
WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = ParserErrorCode(
'WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER',
diff --git a/pkg/analyzer/lib/src/error/codes.g.dart b/pkg/analyzer/lib/src/error/codes.g.dart
index 6ada184..581dc40 100644
--- a/pkg/analyzer/lib/src/error/codes.g.dart
+++ b/pkg/analyzer/lib/src/error/codes.g.dart
@@ -235,6 +235,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode
AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT = CompileTimeErrorCode(
'AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT',
@@ -278,6 +279,7 @@
"Try changing the augmentation to match the declaration kind.",
);
+ /// No parameters.
static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_BOUND =
CompileTimeErrorCode(
'AUGMENTATION_TYPE_PARAMETER_BOUND',
@@ -288,6 +290,7 @@
"parameters.",
);
+ /// No parameters.
static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_COUNT =
CompileTimeErrorCode(
'AUGMENTATION_TYPE_PARAMETER_COUNT',
@@ -298,6 +301,7 @@
"parameters.",
);
+ /// No parameters.
static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_NAME =
CompileTimeErrorCode(
'AUGMENTATION_TYPE_PARAMETER_NAME',
@@ -308,6 +312,7 @@
"parameters.",
);
+ /// No parameters.
static const CompileTimeErrorCode AUGMENTATION_WITHOUT_DECLARATION =
CompileTimeErrorCode(
'AUGMENTATION_WITHOUT_DECLARATION',
@@ -316,6 +321,7 @@
"Try changing the augmentation to match an existing declaration.",
);
+ /// No parameters.
static const CompileTimeErrorCode
AUGMENTED_EXPRESSION_IS_NOT_SETTER = CompileTimeErrorCode(
'AUGMENTED_EXPRESSION_IS_NOT_SETTER',
@@ -324,6 +330,7 @@
correctionMessage: "Try assigning a value to a setter.",
);
+ /// No parameters.
static const CompileTimeErrorCode
AUGMENTED_EXPRESSION_IS_SETTER = CompileTimeErrorCode(
'AUGMENTED_EXPRESSION_IS_SETTER',
@@ -355,6 +362,8 @@
/// 16.30 Await Expressions: It is a compile-time error if the function
/// immediately enclosing _a_ is not declared asynchronous. (Where _a_ is the
/// await expression.)
+ ///
+ /// No parameters.
static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT =
CompileTimeErrorCode(
'AWAIT_IN_WRONG_CONTEXT',
@@ -363,6 +372,7 @@
"Try marking the function body with either 'async' or 'async*'.",
);
+ /// No parameters.
static const CompileTimeErrorCode
AWAIT_OF_INCOMPATIBLE_TYPE = CompileTimeErrorCode(
'AWAIT_OF_INCOMPATIBLE_TYPE',
@@ -569,6 +579,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE =
CompileTimeErrorCode(
'CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE',
@@ -645,7 +656,8 @@
/// Parameters:
/// 0: the name of the class defining the conflicting field
/// 1: the name of the conflicting field
- /// 2: the name of the class defining the method with which the field conflicts
+ /// 2: the name of the class defining the method with which the field
+ /// conflicts
static const CompileTimeErrorCode
CONFLICTING_FIELD_AND_METHOD = CompileTimeErrorCode(
'CONFLICTING_FIELD_AND_METHOD',
@@ -657,7 +669,8 @@
);
/// Parameters:
- /// 0: the name of the kind of the element implementing the conflicting interface
+ /// 0: the name of the kind of the element implementing the conflicting
+ /// interface
/// 1: the name of the element implementing the conflicting interface
/// 2: the first conflicting type
/// 3: the second conflicting type
@@ -690,7 +703,8 @@
/// Parameters:
/// 0: the name of the class defining the conflicting method
/// 1: the name of the conflicting method
- /// 2: the name of the class defining the field with which the method conflicts
+ /// 2: the name of the class defining the field with which the method
+ /// conflicts
static const CompileTimeErrorCode
CONFLICTING_METHOD_AND_FIELD = CompileTimeErrorCode(
'CONFLICTING_METHOD_AND_FIELD',
@@ -708,7 +722,8 @@
/// Parameters:
/// 0: the name of the class defining the conflicting member
/// 1: the name of the conflicting static member
- /// 2: the name of the class defining the field with which the method conflicts
+ /// 2: the name of the class defining the field with which the method
+ /// conflicts
static const CompileTimeErrorCode CONFLICTING_STATIC_AND_INSTANCE =
CompileTimeErrorCode(
'CONFLICTING_STATIC_AND_INSTANCE',
@@ -891,6 +906,8 @@
/// 16.12.2 Const: It is a compile-time error if evaluation of a constant
/// object results in an uncaught exception being thrown.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
CONST_CONSTRUCTOR_THROWS_EXCEPTION = CompileTimeErrorCode(
'CONST_CONSTRUCTOR_THROWS_EXCEPTION',
@@ -991,6 +1008,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_ASSERTION_FAILURE =
CompileTimeErrorCode(
'CONST_EVAL_ASSERTION_FAILURE',
@@ -1005,18 +1023,21 @@
"An assertion failed with message '{0}'.",
);
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_EXTENSION_METHOD =
CompileTimeErrorCode(
'CONST_EVAL_EXTENSION_METHOD',
"Extension methods can't be used in constant expressions.",
);
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_EXTENSION_TYPE_METHOD =
CompileTimeErrorCode(
'CONST_EVAL_EXTENSION_TYPE_METHOD',
"Extension type methods can't be used in constant expressions.",
);
+ /// No parameters.
static const CompileTimeErrorCode
CONST_EVAL_FOR_ELEMENT = CompileTimeErrorCode(
'CONST_EVAL_FOR_ELEMENT',
@@ -1025,6 +1046,7 @@
"Try replacing the 'for' element with a spread, or removing 'const'.",
);
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_METHOD_INVOCATION =
CompileTimeErrorCode(
'CONST_EVAL_METHOD_INVOCATION',
@@ -1033,6 +1055,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form e1 == e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_PRIMITIVE_EQUALITY =
CompileTimeErrorCode(
'CONST_EVAL_PRIMITIVE_EQUALITY',
@@ -1052,6 +1076,8 @@
/// 16.12.2 Const: It is a compile-time error if evaluation of a constant
/// object results in an uncaught exception being thrown.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION =
CompileTimeErrorCode(
'CONST_EVAL_THROWS_EXCEPTION',
@@ -1060,6 +1086,8 @@
/// 16.12.2 Const: It is a compile-time error if evaluation of a constant
/// object results in an uncaught exception being thrown.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE =
CompileTimeErrorCode(
'CONST_EVAL_THROWS_IDBZE',
@@ -1070,6 +1098,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form !e1", "An expression of the form
/// e1 && e2", and "An expression of the form e1 || e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = CompileTimeErrorCode(
'CONST_EVAL_TYPE_BOOL',
"In constant expressions, operands of this operator must be of type "
@@ -1078,6 +1108,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form e1 & e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
CONST_EVAL_TYPE_BOOL_INT = CompileTimeErrorCode(
'CONST_EVAL_TYPE_BOOL_INT',
@@ -1087,6 +1119,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "A literal string".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING =
CompileTimeErrorCode(
'CONST_EVAL_TYPE_BOOL_NUM_STRING',
@@ -1097,6 +1131,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form ~e1", "An expression of one of
/// the forms e1 >> e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = CompileTimeErrorCode(
'CONST_EVAL_TYPE_INT',
"In constant expressions, operands of this operator must be of type 'int'.",
@@ -1104,6 +1140,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form e1 - e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = CompileTimeErrorCode(
'CONST_EVAL_TYPE_NUM',
"In constant expressions, operands of this operator must be of type 'num'.",
@@ -1111,6 +1149,8 @@
/// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
/// for text about "An expression of the form e1 + e2".
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
CONST_EVAL_TYPE_NUM_STRING = CompileTimeErrorCode(
'CONST_EVAL_TYPE_NUM_STRING',
@@ -1126,6 +1166,7 @@
"'String'.",
);
+ /// No parameters.
static const CompileTimeErrorCode CONST_EVAL_TYPE_TYPE = CompileTimeErrorCode(
'CONST_EVAL_TYPE_TYPE',
"In constant expressions, operands of this operator must be of type "
@@ -1398,6 +1439,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode DOT_SHORTHAND_MISSING_CONTEXT =
CompileTimeErrorCode(
'DOT_SHORTHAND_MISSING_CONTEXT',
@@ -1421,7 +1463,8 @@
/// Parameters:
/// 0: the name of the static method or constructor
- /// 1: the name of the enclosing type where the method or constructor is being looked for
+ /// 1: the name of the enclosing type where the method or constructor is being
+ /// looked for
static const CompileTimeErrorCode
DOT_SHORTHAND_UNDEFINED_INVOCATION = CompileTimeErrorCode(
'DOT_SHORTHAND_UNDEFINED_MEMBER',
@@ -1554,6 +1597,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR =
CompileTimeErrorCode(
'ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR',
@@ -1561,6 +1605,7 @@
correctionMessage: "Try using a generative constructor.",
);
+ /// No parameters.
static const CompileTimeErrorCode ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING =
CompileTimeErrorCode(
'ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING',
@@ -1569,6 +1614,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode
ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED = CompileTimeErrorCode(
'ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED',
@@ -1576,6 +1622,7 @@
correctionMessage: "Try using different bounds for type parameters.",
);
+ /// No parameters.
static const CompileTimeErrorCode ENUM_MIXIN_WITH_INSTANCE_VARIABLE =
CompileTimeErrorCode(
'ENUM_MIXIN_WITH_INSTANCE_VARIABLE',
@@ -1584,6 +1631,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode ENUM_WITHOUT_CONSTANTS =
CompileTimeErrorCode(
'ENUM_WITHOUT_CONSTANTS',
@@ -1602,6 +1650,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode ENUM_WITH_NAME_VALUES =
CompileTimeErrorCode(
'ENUM_WITH_NAME_VALUES',
@@ -1973,6 +2022,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode
EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER = CompileTimeErrorCode(
'EXTERNAL_WITH_INITIALIZER',
@@ -1984,6 +2034,7 @@
uniqueName: 'EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER',
);
+ /// No parameters.
static const CompileTimeErrorCode EXTERNAL_FIELD_INITIALIZER =
CompileTimeErrorCode(
'EXTERNAL_WITH_INITIALIZER',
@@ -1994,6 +2045,7 @@
uniqueName: 'EXTERNAL_FIELD_INITIALIZER',
);
+ /// No parameters.
static const CompileTimeErrorCode EXTERNAL_VARIABLE_INITIALIZER =
CompileTimeErrorCode(
'EXTERNAL_WITH_INITIALIZER',
@@ -2132,7 +2184,8 @@
);
/// Parameters:
- /// 0: the name of the final class being used as a mixin superclass constraint.
+ /// 0: the name of the final class being used as a mixin superclass
+ /// constraint.
static const CompileTimeErrorCode
FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode(
'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY',
@@ -2235,6 +2288,8 @@
/// It is a compile-time error if a generic function type is used as a bound
/// for a formal type parameter of a class or a function.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND = CompileTimeErrorCode(
'GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND',
@@ -2246,6 +2301,8 @@
/// It is a compile-time error if a generic function type is used as an actual
/// type argument.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT = CompileTimeErrorCode(
'GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT',
@@ -2295,6 +2352,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode
IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode(
'IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY',
@@ -2352,6 +2410,7 @@
uniqueName: 'ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE',
);
+ /// No parameters.
static const CompileTimeErrorCode ILLEGAL_ENUM_VALUES_DECLARATION =
CompileTimeErrorCode(
'ILLEGAL_ENUM_VALUES',
@@ -2614,7 +2673,8 @@
/// 0: the name of the static member
/// 1: the kind of the static member (field, getter, setter, or method)
/// 2: the name of the static member's enclosing element
- /// 3: the kind of the static member's enclosing element (class, mixin, or extension)
+ /// 3: the kind of the static member's enclosing element (class, mixin, or
+ /// extension)
static const CompileTimeErrorCode INSTANCE_ACCESS_TO_STATIC_MEMBER =
CompileTimeErrorCode(
'INSTANCE_ACCESS_TO_STATIC_MEMBER',
@@ -2760,12 +2820,12 @@
hasPublishedDocs: true,
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the name of the function
/// 1: the type of the function
/// 2: the expected function type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode
INVALID_CAST_FUNCTION = CompileTimeErrorCode(
'INVALID_CAST_FUNCTION',
@@ -2773,11 +2833,11 @@
"means its parameter or return type doesn't match what is expected.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the type of the torn-off function expression
/// 1: the expected function type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode
INVALID_CAST_FUNCTION_EXPR = CompileTimeErrorCode(
'INVALID_CAST_FUNCTION_EXPR',
@@ -2786,22 +2846,22 @@
"changing parameter type(s) or the returned type(s).",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the lexeme of the literal
/// 1: the type of the literal
/// 2: the expected type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode INVALID_CAST_LITERAL = CompileTimeErrorCode(
'INVALID_CAST_LITERAL',
"The literal '{0}' with type '{1}' isn't of expected type '{2}'.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the type of the list literal
/// 1: the expected type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode
INVALID_CAST_LITERAL_LIST = CompileTimeErrorCode(
'INVALID_CAST_LITERAL_LIST',
@@ -2810,11 +2870,11 @@
"the element types.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the type of the map literal
/// 1: the expected type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode
INVALID_CAST_LITERAL_MAP = CompileTimeErrorCode(
'INVALID_CAST_LITERAL_MAP',
@@ -2823,11 +2883,11 @@
"the key and value types.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the type of the set literal
/// 1: the expected type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode
INVALID_CAST_LITERAL_SET = CompileTimeErrorCode(
'INVALID_CAST_LITERAL_SET',
@@ -2836,12 +2896,12 @@
"the element types.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the name of the torn-off method
/// 1: the type of the torn-off method
/// 2: the expected function type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode INVALID_CAST_METHOD = CompileTimeErrorCode(
'INVALID_CAST_METHOD',
"The method tear-off '{0}' has type '{1}' that isn't of expected type "
@@ -2849,11 +2909,11 @@
"expected.",
);
+ /// This error is only reported in libraries which are not null safe.
+ ///
/// Parameters:
/// 0: the type of the instantiated object
/// 1: the expected type
- ///
- /// This error is only reported in libraries which are not null safe.
static const CompileTimeErrorCode INVALID_CAST_NEW_EXPR =
CompileTimeErrorCode(
'INVALID_CAST_NEW_EXPR',
@@ -2865,6 +2925,8 @@
/// for more informative errors.
///
/// See TODOs in ConstantVisitor
+ ///
+ /// No parameters.
static const CompileTimeErrorCode INVALID_CONSTANT = CompileTimeErrorCode(
'INVALID_CONSTANT',
"Invalid constant value.",
@@ -2920,15 +2982,15 @@
uniqueName: 'INVALID_FIELD_NAME_PRIVATE',
);
+ /// The parameters of this error code must be kept in sync with those of
+ /// [CompileTimeErrorCode.INVALID_OVERRIDE].
+ ///
/// Parameters:
/// 0: the name of the declared member that is not a valid override.
/// 1: the name of the interface that declares the member.
/// 2: the type of the declared member in the interface.
/// 3: the name of the interface with the overridden member.
/// 4: the type of the overridden member.
- ///
- /// These parameters must be kept in sync with those of
- /// [CompileTimeErrorCode.INVALID_OVERRIDE].
static const CompileTimeErrorCode INVALID_IMPLEMENTATION_OVERRIDE =
CompileTimeErrorCode(
'INVALID_IMPLEMENTATION_OVERRIDE',
@@ -2937,15 +2999,15 @@
hasPublishedDocs: true,
);
+ /// The parameters of this error code must be kept in sync with those of
+ /// [CompileTimeErrorCode.INVALID_OVERRIDE].
+ ///
/// Parameters:
/// 0: the name of the declared setter that is not a valid override.
/// 1: the name of the interface that declares the setter.
/// 2: the type of the declared setter in the interface.
/// 3: the name of the interface with the overridden setter.
/// 4: the type of the overridden setter.
- ///
- /// These parameters must be kept in sync with those of
- /// [CompileTimeErrorCode.INVALID_OVERRIDE].
static const CompileTimeErrorCode INVALID_IMPLEMENTATION_OVERRIDE_SETTER =
CompileTimeErrorCode(
'INVALID_IMPLEMENTATION_OVERRIDE',
@@ -3012,6 +3074,7 @@
uniqueName: 'INVALID_OVERRIDE_SETTER',
);
+ /// No parameters.
static const CompileTimeErrorCode
INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR = CompileTimeErrorCode(
'INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR',
@@ -3088,6 +3151,8 @@
);
/// The 'covariant' keyword was found in an inappropriate location.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode INVALID_USE_OF_COVARIANT =
CompileTimeErrorCode(
'INVALID_USE_OF_COVARIANT',
@@ -3293,6 +3358,8 @@
///
/// Note: This diagnostic is never displayed to the user, so it doesn't need
/// to be documented.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL =
CompileTimeErrorCode(
'MISSING_CONST_IN_LIST_LITERAL',
@@ -3303,6 +3370,8 @@
///
/// Note: This diagnostic is never displayed to the user, so it doesn't need
/// to be documented.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL =
CompileTimeErrorCode(
'MISSING_CONST_IN_MAP_LITERAL',
@@ -3313,6 +3382,8 @@
///
/// Note: This diagnostic is never displayed to the user, so it doesn't need
/// to be documented.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode MISSING_CONST_IN_SET_LITERAL =
CompileTimeErrorCode(
'MISSING_CONST_IN_SET_LITERAL',
@@ -3595,6 +3666,8 @@
/// 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
/// denote a class available in the immediately enclosing scope.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS =
CompileTimeErrorCode(
'MIXIN_WITH_NON_CLASS_SUPERCLASS',
@@ -3943,6 +4016,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR =
CompileTimeErrorCode(
'NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR',
@@ -3954,6 +4028,8 @@
/// 13.2 Expression Statements: It is a compile-time error if a non-constant
/// map literal that has no explicit type arguments appears in a place where a
/// statement is expected.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
NON_CONST_MAP_AS_EXPRESSION_STATEMENT = CompileTimeErrorCode(
'NON_CONST_MAP_AS_EXPRESSION_STATEMENT',
@@ -4269,7 +4345,8 @@
/// Parameters:
/// 0: the name of the superclass that does not define an implicitly invoked
/// constructor
- /// 1: the name of the subclass that does not contain any explicit constructors
+ /// 1: the name of the subclass that does not contain any explicit
+ /// constructors
static const CompileTimeErrorCode
NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = CompileTimeErrorCode(
'NO_DEFAULT_SUPER_CONSTRUCTOR',
@@ -4334,6 +4411,8 @@
/// 7.9 Superclasses: It is a compile-time error to specify an extends clause
/// for class Object.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS =
CompileTimeErrorCode(
'OBJECT_CANNOT_EXTEND_ANOTHER_CLASS',
@@ -4593,6 +4672,8 @@
);
/// The documentation is in `front_end/message.yaml`.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA = CompileTimeErrorCode(
'RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA',
@@ -4617,13 +4698,13 @@
"The constant constructor depends on itself.",
);
- /// No parameters.
- ///
/// TODO(scheglov): review this later, there are no explicit "it is a
/// compile-time error" in specification. But it was added to the co19 and
/// there is same error for factories.
///
/// https://code.google.com/p/dart/issues/detail?id=954
+ ///
+ /// No parameters.
static const CompileTimeErrorCode
RECURSIVE_CONSTRUCTOR_REDIRECT = CompileTimeErrorCode(
'RECURSIVE_CONSTRUCTOR_REDIRECT',
@@ -4745,7 +4826,8 @@
/// Parameters:
/// 0: the name of the redirecting constructor
- /// 1: the name of the abstract class defining the constructor being redirected to
+ /// 1: the name of the abstract class defining the constructor being
+ /// redirected to
static const CompileTimeErrorCode
REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR = CompileTimeErrorCode(
'REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR',
@@ -5022,6 +5104,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY =
CompileTimeErrorCode(
'SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY',
@@ -5101,6 +5184,8 @@
/// 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
/// is a compile-time error if a generative constructor of class Object
/// includes a superinitializer.
+ ///
+ /// No parameters.
static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT =
CompileTimeErrorCode(
'SUPER_INITIALIZER_IN_OBJECT',
@@ -5248,11 +5333,11 @@
hasPublishedDocs: true,
);
+ /// See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
+ ///
/// Parameters:
/// 0: the name of the type parameter
/// 1: the name of the bounding type
- ///
- /// See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
static const CompileTimeErrorCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND =
CompileTimeErrorCode(
'TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND',
@@ -5284,6 +5369,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode
UNCHECKED_INVOCATION_OF_NULLABLE_VALUE = CompileTimeErrorCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
@@ -5333,6 +5419,7 @@
uniqueName: 'UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE',
);
+ /// No parameters.
static const CompileTimeErrorCode
UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION = CompileTimeErrorCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
@@ -5344,6 +5431,7 @@
uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION',
);
+ /// No parameters.
static const CompileTimeErrorCode
UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR = CompileTimeErrorCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
@@ -5355,6 +5443,7 @@
uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR',
);
+ /// No parameters.
static const CompileTimeErrorCode
UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD = CompileTimeErrorCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
@@ -5366,6 +5455,7 @@
uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD',
);
+ /// No parameters.
static const CompileTimeErrorCode
UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH = CompileTimeErrorCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
@@ -5467,6 +5557,7 @@
uniqueName: 'UNDEFINED_ENUM_CONSTRUCTOR_NAMED',
);
+ /// No parameters.
static const CompileTimeErrorCode UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED =
CompileTimeErrorCode(
'UNDEFINED_ENUM_CONSTRUCTOR',
@@ -5809,6 +5900,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const CompileTimeErrorCode VALUES_DECLARATION_IN_ENUM =
CompileTimeErrorCode(
'VALUES_DECLARATION_IN_ENUM',
@@ -5842,8 +5934,8 @@
/// Parameters:
/// 0: the name of the type parameter
/// 1: the variance modifier defined for {0}
- /// 2: the variance position of the type parameter {0} in the
- /// superinterface {3}
+ /// 2: the variance position of the type parameter {0} in the superinterface
+ /// {3}
/// 3: the name of the superinterface
static const CompileTimeErrorCode
WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE = CompileTimeErrorCode(
@@ -6462,6 +6554,7 @@
correctionMessage: "Try removing the unexpected argument.",
);
+ /// No parameters.
static const WarningCode DOC_DIRECTIVE_MISSING_CLOSING_BRACE = WarningCode(
'DOC_DIRECTIVE_MISSING_CLOSING_BRACE',
"Doc directive is missing a closing curly brace ('}').",
@@ -6529,6 +6622,7 @@
correctionMessage: "Try using one of the supported doc directives.",
);
+ /// No parameters.
static const WarningCode DOC_IMPORT_CANNOT_BE_DEFERRED = WarningCode(
'DOC_IMPORT_CANNOT_BE_DEFERRED',
"Doc imports can't be deferred.",
@@ -6536,6 +6630,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const WarningCode DOC_IMPORT_CANNOT_HAVE_COMBINATORS = WarningCode(
'DOC_IMPORT_CANNOT_HAVE_COMBINATORS',
"Doc imports can't have show or hide combinators.",
@@ -6543,6 +6638,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const WarningCode DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS = WarningCode(
'DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS',
"Doc imports can't have configurations.",
@@ -6550,6 +6646,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const WarningCode DOC_IMPORT_CANNOT_HAVE_PREFIX = WarningCode(
'DOC_IMPORT_CANNOT_HAVE_PREFIX',
"Doc imports can't have prefixes.",
@@ -6762,8 +6859,9 @@
);
/// Parameters:
- /// 0: the name of the element
- /// 1: ?
+ /// 0: the name of the internal element
+ /// 1: the name of the exported element that indirectly exposes the internal
+ /// element
static const WarningCode
INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY = WarningCode(
'INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY',
@@ -6835,6 +6933,7 @@
uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER',
);
+ /// No parameters.
static const WarningCode
INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION = WarningCode(
'INVALID_LANGUAGE_VERSION_OVERRIDE',
@@ -6921,7 +7020,7 @@
/// This warning is generated anywhere where `@nonVirtual` annotates something
/// other than a non-abstract instance member in a class or mixin.
///
- /// No Parameters.
+ /// No parameters.
static const WarningCode INVALID_NON_VIRTUAL_ANNOTATION = WarningCode(
'INVALID_NON_VIRTUAL_ANNOTATION',
"The annotation '@nonVirtual' can only be applied to a concrete instance "
@@ -7088,6 +7187,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const WarningCode INVALID_WIDGET_PREVIEW_APPLICATION = WarningCode(
'INVALID_WIDGET_PREVIEW_APPLICATION',
"The '@Preview(...)' annotation can only be applied to public, statically "
@@ -7359,7 +7459,7 @@
/// dead or unreachable code are encouraged to indicate that any arguments to
/// the call are unreachable.
///
- /// Parameters: none
+ /// No parameters.
static const WarningCode RECEIVER_OF_TYPE_NEVER = WarningCode(
'RECEIVER_OF_TYPE_NEVER',
"The receiver is of type 'Never', and will never complete with a value.",
@@ -7437,12 +7537,12 @@
uniqueName: 'RETURN_TYPE_INVALID_FOR_CATCH_ERROR',
);
- /// No parameters.
- ///
/// There is also a [ParserErrorCode.EXPERIMENT_NOT_ENABLED] code which
/// catches some cases of constructor tearoff features (like
/// `List<int>.filled;`). Other constructor tearoff cases are not realized
/// until resolution (like `List.filled;`).
+ ///
+ /// No parameters.
static const WarningCode SDK_VERSION_CONSTRUCTOR_TEAROFFS = WarningCode(
'SDK_VERSION_CONSTRUCTOR_TEAROFFS',
"Tearing off a constructor requires the 'constructor-tearoffs' language "
diff --git a/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart b/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
index 18917cb..c81d129 100644
--- a/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
+++ b/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
@@ -29,6 +29,8 @@
class ManifestWarningCode extends DiagnosticCode {
/// A code indicating that the camera permissions is not supported on Chrome
/// OS.
+ ///
+ /// No parameters.
static const ManifestWarningCode
CAMERA_PERMISSIONS_INCOMPATIBLE = ManifestWarningCode(
'CAMERA_PERMISSIONS_INCOMPATIBLE',
@@ -43,6 +45,8 @@
);
/// A code indicating that the activity is set to be non resizable.
+ ///
+ /// No parameters.
static const ManifestWarningCode NON_RESIZABLE_ACTIVITY = ManifestWarningCode(
'NON_RESIZABLE_ACTIVITY',
"The `<activity>` element should be allowed to be resized to allow users "
@@ -54,6 +58,8 @@
/// A code indicating that the touchscreen feature is not specified in the
/// manifest.
+ ///
+ /// No parameters.
static const ManifestWarningCode NO_TOUCHSCREEN_FEATURE = ManifestWarningCode(
'NO_TOUCHSCREEN_FEATURE',
"The default \"android.hardware.touchscreen\" needs to be optional for "
@@ -80,6 +86,8 @@
);
/// A code indicating that the activity is locked to an orientation.
+ ///
+ /// No parameters.
static const ManifestWarningCode
SETTING_ORIENTATION_ON_ACTIVITY = ManifestWarningCode(
'SETTING_ORIENTATION_ON_ACTIVITY',
diff --git a/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart b/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
index c67ab91..3e8a5f0 100644
--- a/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
+++ b/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
@@ -65,10 +65,10 @@
hasPublishedDocs: true,
);
- /// No parameters.
- ///
/// This code is deprecated in favor of the
/// 'ASSET_NOT_STRING_OR_MAP' code, and will be removed.
+ ///
+ /// No parameters.
static const PubspecWarningCode ASSET_NOT_STRING = PubspecWarningCode(
'ASSET_NOT_STRING',
"Assets are required to be file paths (strings).",
@@ -141,7 +141,8 @@
/// Parameters:
/// 0: the list of packages missing from the dependencies and the list of
- /// packages missing from the dev_dependencies (if any) in the pubspec file.
+ /// packages missing from the dev_dependencies (if any) in the pubspec
+ /// file.
static const PubspecWarningCode MISSING_DEPENDENCY = PubspecWarningCode(
'MISSING_DEPENDENCY',
"Missing a dependency on imported package '{0}'.",
diff --git a/pkg/analyzer/messages.yaml b/pkg/analyzer/messages.yaml
index 7cbceb3..409465f 100644
--- a/pkg/analyzer/messages.yaml
+++ b/pkg/analyzer/messages.yaml
@@ -65,7 +65,7 @@
ANALYSIS_OPTION_DEPRECATED:
problemMessage: "The option '{0}' is no longer supported."
hasPublishedDocs: false
- comment: |
+ comment: |-
An error code indicating that the given option is deprecated.
Parameters:
@@ -1152,6 +1152,7 @@
problemMessage: The augmentation has an 'extends' clause, but an augmentation target already includes an 'extends' clause and it isn't allowed to be repeated or changed.
correctionMessage: Try removing the 'extends' clause, either here or in the augmentation target.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTATION_MODIFIER_EXTRA:
experiment: augmentations
problemMessage: The augmentation has the '{0}' modifier that the declaration doesn't have.
@@ -1182,31 +1183,37 @@
problemMessage: The augmentation type parameter must have the same bound as the corresponding type parameter of the declaration.
correctionMessage: Try changing the augmentation to match the declaration type parameters.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTATION_TYPE_PARAMETER_COUNT:
experiment: augmentations
problemMessage: The augmentation must have the same number of type parameters as the declaration.
correctionMessage: Try changing the augmentation to match the declaration type parameters.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTATION_TYPE_PARAMETER_NAME:
experiment: augmentations
problemMessage: The augmentation type parameter must have the same name as the corresponding type parameter of the declaration.
correctionMessage: Try changing the augmentation to match the declaration type parameters.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTATION_WITHOUT_DECLARATION:
experiment: augmentations
problemMessage: The declaration being augmented doesn't exist.
correctionMessage: Try changing the augmentation to match an existing declaration.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTED_EXPRESSION_IS_NOT_SETTER:
experiment: augmentations
problemMessage: The augmented declaration is not a setter, it can't be used to write a value.
correctionMessage: Try assigning a value to a setter.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTED_EXPRESSION_IS_SETTER:
experiment: augmentations
problemMessage: The augmented declaration is a setter, it can't be used to read a value.
correctionMessage: Try assigning a value to the augmented setter.
hasPublishedDocs: false
+ comment: No parameters.
AUGMENTED_EXPRESSION_NOT_OPERATOR:
experiment: augmentations
problemMessage: The enclosing augmentation doesn't augment the operator '{0}'.
@@ -1265,10 +1272,13 @@
16.30 Await Expressions: It is a compile-time error if the function
immediately enclosing _a_ is not declared asynchronous. (Where _a_ is the
await expression.)
+
+ No parameters.
AWAIT_OF_INCOMPATIBLE_TYPE:
problemMessage: "The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'."
correctionMessage: Try removing the `await`, or updating the extension type to implement 'Future'.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -1906,6 +1916,7 @@
problemMessage: Generative enum constructors must be 'const'.
correctionMessage: Try adding the keyword 'const'.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -2103,7 +2114,10 @@
problemMessage: "A record literal with exactly one positional field requires a trailing comma."
correctionMessage: Try adding a trailing comma.
hasPublishedDocs: true
- comment: The documentation is in `front_end/message.yaml`.
+ comment: |-
+ The documentation is in `front_end/message.yaml`.
+
+ No parameters.
SET_ELEMENT_FROM_DEFERRED_LIBRARY:
sharedName: COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY
problemMessage: "Constant values from a deferred library can't be used as values in a 'const' set literal."
@@ -2114,6 +2128,7 @@
problemMessage: "Concrete classes can't have 'Enum' as a superinterface."
correctionMessage: Try specifying a different interface, or remove it from the list.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -2283,13 +2298,15 @@
Parameters:
0: the name of the class defining the conflicting field
1: the name of the conflicting field
- 2: the name of the class defining the method with which the field conflicts
+ 2: the name of the class defining the method with which the field
+ conflicts
CONFLICTING_GENERIC_INTERFACES:
problemMessage: "The {0} '{1}' can't implement both '{2}' and '{3}' because the type arguments are different."
hasPublishedDocs: true
comment: |-
Parameters:
- 0: the name of the kind of the element implementing the conflicting interface
+ 0: the name of the kind of the element implementing the conflicting
+ interface
1: the name of the element implementing the conflicting interface
2: the first conflicting type
3: the second conflicting type
@@ -2349,7 +2366,8 @@
Parameters:
0: the name of the class defining the conflicting method
1: the name of the conflicting method
- 2: the name of the class defining the field with which the method conflicts
+ 2: the name of the class defining the field with which the method
+ conflicts
CONFLICTING_STATIC_AND_INSTANCE:
problemMessage: "Class '{0}' can't define static member '{1}' and have instance member '{2}.{1}' with the same name."
correctionMessage: "Try renaming the member to a name that doesn't conflict."
@@ -2362,7 +2380,8 @@
Parameters:
0: the name of the class defining the conflicting member
1: the name of the conflicting static member
- 2: the name of the class defining the field with which the method conflicts
+ 2: the name of the class defining the field with which the method
+ conflicts
CONFLICTING_TYPE_VARIABLE_AND_CLASS:
sharedName: CONFLICTING_TYPE_VARIABLE_AND_CONTAINER
problemMessage: "'{0}' can't be used to name both a type parameter and the class in which the type parameter is defined."
@@ -2569,6 +2588,8 @@
comment: |-
16.12.2 Const: It is a compile-time error if evaluation of a constant
object results in an uncaught exception being thrown.
+
+ No parameters.
CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST:
problemMessage: "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value."
correctionMessage: "Try initializing the field to a constant value, or removing the keyword 'const' from the constructor."
@@ -2823,6 +2844,7 @@
CONST_EVAL_ASSERTION_FAILURE:
problemMessage: "The assertion in this constant expression failed."
hasPublishedDocs: false
+ comment: No parameters.
CONST_EVAL_ASSERTION_FAILURE_WITH_MESSAGE:
problemMessage: "An assertion failed with message '{0}'."
hasPublishedDocs: false
@@ -2832,13 +2854,16 @@
CONST_EVAL_EXTENSION_METHOD:
problemMessage: "Extension methods can't be used in constant expressions."
hasPublishedDocs: false
+ comment: No parameters.
CONST_EVAL_EXTENSION_TYPE_METHOD:
problemMessage: "Extension type methods can't be used in constant expressions."
hasPublishedDocs: false
+ comment: No parameters.
CONST_EVAL_FOR_ELEMENT:
problemMessage: "Constant expressions don't support 'for' elements."
correctionMessage: "Try replacing the 'for' element with a spread, or removing 'const'."
hasPublishedDocs: false
+ comment: No parameters.
CONST_EVAL_PROPERTY_ACCESS:
problemMessage: "The property '{0}' can't be accessed on the type '{1}' in a constant expression."
hasPublishedDocs: false
@@ -2849,18 +2874,23 @@
CONST_EVAL_METHOD_INVOCATION:
problemMessage: "Methods can't be invoked in constant expressions."
hasPublishedDocs: false
+ comment: No parameters.
CONST_EVAL_THROWS_EXCEPTION:
problemMessage: Evaluation of this constant expression throws an exception.
hasPublishedDocs: false
comment: |-
16.12.2 Const: It is a compile-time error if evaluation of a constant
object results in an uncaught exception being thrown.
+
+ No parameters.
CONST_EVAL_THROWS_IDBZE:
problemMessage: Evaluation of this constant expression throws an IntegerDivisionByZeroException.
hasPublishedDocs: false
comment: |-
16.12.2 Const: It is a compile-time error if evaluation of a constant
object results in an uncaught exception being thrown.
+
+ No parameters.
CONST_EVAL_TYPE_BOOL:
problemMessage: "In constant expressions, operands of this operator must be of type 'bool'."
hasPublishedDocs: false
@@ -2868,24 +2898,32 @@
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form !e1", "An expression of the form
e1 && e2", and "An expression of the form e1 || e2".
+
+ No parameters.
CONST_EVAL_TYPE_BOOL_INT:
problemMessage: "In constant expressions, operands of this operator must be of type 'bool' or 'int'."
hasPublishedDocs: false
comment: |-
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form e1 & e2".
+
+ No parameters.
CONST_EVAL_TYPE_BOOL_NUM_STRING:
problemMessage: "In constant expressions, operands of this operator must be of type 'bool', 'num', 'String' or 'null'."
hasPublishedDocs: false
comment: |-
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "A literal string".
+
+ No parameters.
CONST_EVAL_PRIMITIVE_EQUALITY:
problemMessage: "In constant expressions, operands of the equality operator must have primitive equality."
hasPublishedDocs: false
comment: |-
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form e1 == e2".
+
+ No parameters.
CONST_EVAL_TYPE_INT:
problemMessage: "In constant expressions, operands of this operator must be of type 'int'."
hasPublishedDocs: false
@@ -2893,18 +2931,24 @@
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form ~e1", "An expression of one of
the forms e1 >> e2".
+
+ No parameters.
CONST_EVAL_TYPE_NUM:
problemMessage: "In constant expressions, operands of this operator must be of type 'num'."
hasPublishedDocs: false
comment: |-
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form e1 - e2".
+
+ No parameters.
CONST_EVAL_TYPE_NUM_STRING:
problemMessage: "In constant expressions, operands of this operator must be of type 'num' or 'String'."
hasPublishedDocs: false
comment: |-
See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants",
for text about "An expression of the form e1 + e2".
+
+ No parameters.
CONST_EVAL_TYPE_STRING:
problemMessage: "In constant expressions, operands of this operator must be of type 'String'."
hasPublishedDocs: false
@@ -2912,6 +2956,7 @@
CONST_EVAL_TYPE_TYPE:
problemMessage: "In constant expressions, operands of this operator must be of type 'Type'."
hasPublishedDocs: false
+ comment: No parameters.
CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE:
problemMessage: Const variables must be initialized with a constant value.
correctionMessage: Try changing the initializer to be a constant expression.
@@ -3879,6 +3924,7 @@
experiment: dot-shorthands
problemMessage: "A dot shorthand can't be used where there is no context type."
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -3988,7 +4034,8 @@
comment: |-
Parameters:
0: the name of the static method or constructor
- 1: the name of the enclosing type where the method or constructor is being looked for
+ 1: the name of the enclosing type where the method or constructor is being
+ looked for
DUPLICATE_CONSTRUCTOR_DEFAULT:
sharedName: DUPLICATE_CONSTRUCTOR
problemMessage: The unnamed constructor is already defined.
@@ -4509,10 +4556,12 @@
problemMessage: "An enum value can't invoke a factory constructor."
correctionMessage: Try using a generative constructor.
hasPublishedDocs: false
+ comment: No parameters.
ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING:
problemMessage: "The name of the enum value can't be the same as the enum's name."
correctionMessage: Try renaming the constant.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -4589,10 +4638,12 @@
problemMessage: The result of instantiating the enum to bounds is not well-bounded.
correctionMessage: Try using different bounds for type parameters.
hasPublishedDocs: false
+ comment: No parameters.
ENUM_MIXIN_WITH_INSTANCE_VARIABLE:
problemMessage: Mixins applied to enums can't have instance variables.
correctionMessage: Try replacing the instance variables with getters.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -4681,6 +4732,7 @@
problemMessage: The name 'values' is not a valid name for an enum.
correctionMessage: Try using a different name.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -4706,6 +4758,7 @@
problemMessage: The enum must have at least one enum constant.
correctionMessage: Try declaring an enum constant.
hasPublishedDocs: false
+ comment: No parameters.
EQUAL_ELEMENTS_IN_CONST_SET:
problemMessage: "Two elements in a constant set literal can't be equal."
correctionMessage: Change or remove the duplicate element.
@@ -6012,6 +6065,7 @@
problemMessage: External fields can't have initializers.
correctionMessage: "Try removing the field initializer or the 'external' keyword from the field declaration."
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -6061,11 +6115,13 @@
problemMessage: External fields can't have initializers.
correctionMessage: "Try removing the initializer or the 'external' keyword."
hasPublishedDocs: true
+ comment: No parameters.
EXTERNAL_VARIABLE_INITIALIZER:
sharedName: EXTERNAL_WITH_INITIALIZER
problemMessage: External variables can't have initializers.
correctionMessage: "Try removing the initializer or the 'external' keyword."
hasPublishedDocs: true
+ comment: No parameters.
EXTRA_POSITIONAL_ARGUMENTS:
problemMessage: "Too many positional arguments: {0} expected, but {1} found."
correctionMessage: Try removing the extra arguments.
@@ -6586,7 +6642,8 @@
hasPublishedDocs: true
comment: |-
Parameters:
- 0: the name of the final class being used as a mixin superclass constraint.
+ 0: the name of the final class being used as a mixin superclass
+ constraint.
FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR:
problemMessage: "'{0}' is final and was given a value when it was declared, so it can't be set to a new value."
correctionMessage: Try removing one of the initializations.
@@ -6931,6 +6988,8 @@
comment: |-
It is a compile-time error if a generic function type is used as a bound
for a formal type parameter of a class or a function.
+
+ No parameters.
GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT:
problemMessage: "A generic function type can't be a type argument."
correctionMessage: "Try removing type parameters from the generic function type, or using 'dynamic' as the type argument here."
@@ -6938,6 +6997,8 @@
comment: |-
It is a compile-time error if a generic function type is used as an actual
type argument.
+
+ No parameters.
GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC:
problemMessage: "A method tear-off on a receiver whose type is 'dynamic' can't have type arguments."
correctionMessage: Specify the type of the receiver, or remove the type arguments from the method tear-off.
@@ -7051,6 +7112,7 @@
problemMessage: "Constant values from a deferred library can't be used as values in an if condition inside a const collection literal."
correctionMessage: Try making the deferred import non-deferred.
hasPublishedDocs: false
+ comment: No parameters.
ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE:
problemMessage: "Functions marked 'async*' must have a return type that is a supertype of 'Stream<T>' for some type 'T'."
correctionMessage: "Try fixing the return type of the function, or removing the modifier 'async*' from the function body."
@@ -7132,6 +7194,7 @@
problemMessage: An instance member named 'values' can't be declared in a class that implements 'Enum'.
correctionMessage: Try using a different name.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -8018,7 +8081,8 @@
0: the name of the static member
1: the kind of the static member (field, getter, setter, or method)
2: the name of the static member's enclosing element
- 3: the kind of the static member's enclosing element (class, mixin, or extension)
+ 3: the kind of the static member's enclosing element (class, mixin, or
+ extension)
documentation: |-
#### Description
@@ -8565,77 +8629,77 @@
problemMessage: "The function '{0}' has type '{1}' that isn't of expected type '{2}'. This means its parameter or return type doesn't match what is expected."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the name of the function
1: the type of the function
2: the expected function type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_FUNCTION_EXPR:
problemMessage: The function expression type '{0}' isn't of type '{1}'. This means its parameter or return type doesn't match what is expected. Consider changing parameter type(s) or the returned type(s).
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the type of the torn-off function expression
1: the expected function type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_LITERAL:
problemMessage: "The literal '{0}' with type '{1}' isn't of expected type '{2}'."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the lexeme of the literal
1: the type of the literal
2: the expected type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_LITERAL_LIST:
problemMessage: "The list literal type '{0}' isn't of expected type '{1}'. The list's type can be changed with an explicit generic type argument or by changing the element types."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the type of the list literal
1: the expected type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_LITERAL_MAP:
problemMessage: "The map literal type '{0}' isn't of expected type '{1}'. The map's type can be changed with an explicit generic type arguments or by changing the key and value types."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the type of the map literal
1: the expected type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_LITERAL_SET:
problemMessage: "The set literal type '{0}' isn't of expected type '{1}'. The set's type can be changed with an explicit generic type argument or by changing the element types."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the type of the set literal
1: the expected type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_METHOD:
problemMessage: "The method tear-off '{0}' has type '{1}' that isn't of expected type '{2}'. This means its parameter or return type doesn't match what is expected."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the name of the torn-off method
1: the type of the torn-off method
2: the expected function type
-
- This error is only reported in libraries which are not null safe.
INVALID_CAST_NEW_EXPR:
problemMessage: "The constructor returns type '{0}' that isn't of expected type '{1}'."
hasPublishedDocs: false
comment: |-
+ This error is only reported in libraries which are not null safe.
+
Parameters:
0: the type of the instantiated object
1: the expected type
-
- This error is only reported in libraries which are not null safe.
INVALID_CONSTANT:
problemMessage: Invalid constant value.
hasPublishedDocs: false
@@ -8645,6 +8709,8 @@
for more informative errors.
See TODOs in ConstantVisitor
+
+ No parameters.
INVALID_EXTENSION_ARGUMENT_COUNT:
problemMessage: "Extension overrides must have exactly one argument: the value of 'this' in the extension method."
correctionMessage: Try specifying exactly one argument.
@@ -8855,15 +8921,15 @@
problemMessage: "'{1}.{0}' ('{2}') isn't a valid concrete implementation of '{3}.{0}' ('{4}')."
hasPublishedDocs: true
comment: |-
+ The parameters of this error code must be kept in sync with those of
+ [CompileTimeErrorCode.INVALID_OVERRIDE].
+
Parameters:
0: the name of the declared member that is not a valid override.
1: the name of the interface that declares the member.
2: the type of the declared member in the interface.
3: the name of the interface with the overridden member.
4: the type of the overridden member.
-
- These parameters must be kept in sync with those of
- [CompileTimeErrorCode.INVALID_OVERRIDE].
documentation: |-
#### Description
@@ -8951,15 +9017,15 @@
problemMessage: "The setter '{1}.{0}' ('{2}') isn't a valid concrete implementation of '{3}.{0}' ('{4}')."
hasPublishedDocs: true
comment: |-
+ The parameters of this error code must be kept in sync with those of
+ [CompileTimeErrorCode.INVALID_OVERRIDE].
+
Parameters:
0: the name of the declared setter that is not a valid override.
1: the name of the interface that declares the setter.
2: the type of the declared setter in the interface.
3: the name of the interface with the overridden setter.
4: the type of the overridden setter.
-
- These parameters must be kept in sync with those of
- [CompileTimeErrorCode.INVALID_OVERRIDE].
INVALID_INLINE_FUNCTION_TYPE:
problemMessage: "Inline function types can't be used for parameters in a generic function type."
correctionMessage: "Try using a generic function type (returnType 'Function(' parameters ')')."
@@ -9158,6 +9224,7 @@
problemMessage: Generative enum constructors can only be used as targets of redirection.
correctionMessage: Try using an enum value, or a factory constructor.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -9426,7 +9493,10 @@
problemMessage: "The 'covariant' keyword can only be used for parameters in instance methods or before non-final instance fields."
correctionMessage: "Try removing the 'covariant' keyword."
hasPublishedDocs: false
- comment: "The 'covariant' keyword was found in an inappropriate location."
+ comment: |-
+ The 'covariant' keyword was found in an inappropriate location.
+
+ No parameters.
INVALID_USE_OF_NULL_VALUE:
problemMessage: "An expression whose value is always 'null' can't be dereferenced."
correctionMessage: Try changing the type of the expression.
@@ -10130,6 +10200,8 @@
Note: This diagnostic is never displayed to the user, so it doesn't need
to be documented.
+
+ No parameters.
MISSING_CONST_IN_MAP_LITERAL:
problemMessage: Seeing this message constitutes a bug. Please report it.
hasPublishedDocs: false
@@ -10138,6 +10210,8 @@
Note: This diagnostic is never displayed to the user, so it doesn't need
to be documented.
+
+ No parameters.
MISSING_CONST_IN_SET_LITERAL:
problemMessage: Seeing this message constitutes a bug. Please report it.
hasPublishedDocs: false
@@ -10146,6 +10220,8 @@
Note: This diagnostic is never displayed to the user, so it doesn't need
to be documented.
+
+ No parameters.
MISSING_DART_LIBRARY:
problemMessage: "Required library '{0}' is missing."
correctionMessage: Re-install the Dart or Flutter SDK.
@@ -10961,6 +11037,8 @@
comment: |-
9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
denote a class available in the immediately enclosing scope.
+
+ No parameters.
MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS:
problemMessage: Constructors can have only one 'this' redirection, at most.
correctionMessage: Try removing all but one of the redirections.
@@ -11933,6 +12011,8 @@
13.2 Expression Statements: It is a compile-time error if a non-constant
map literal that has no explicit type arguments appears in a place where a
statement is expected.
+
+ No parameters.
NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE:
problemMessage: "An extension type parameter can't be used in a non-covariant position of its representation type."
correctionMessage: "Try removing the type parameters from function parameter types and type parameter bounds."
@@ -13005,7 +13085,8 @@
Parameters:
0: the name of the superclass that does not define an implicitly invoked
constructor
- 1: the name of the subclass that does not contain any explicit constructors
+ 1: the name of the subclass that does not contain any explicit
+ constructors
NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS:
problemMessage: "The class '{0}' can't extend '{1}' because '{1}' only has factory constructors (no generative constructors), and '{0}' has at least one generative constructor."
correctionMessage: "Try implementing the class instead, adding a generative (not factory) constructor to the superclass '{1}', or a factory constructor to the subclass."
@@ -13229,6 +13310,8 @@
comment: |-
7.9 Superclasses: It is a compile-time error to specify an extends clause
for class Object.
+
+ No parameters.
OBSOLETE_COLON_FOR_DEFAULT_VALUE:
problemMessage: Using a colon as the separator before a default value is no longer supported.
correctionMessage: Try replacing the colon with an equal sign.
@@ -14229,13 +14312,13 @@
correctionMessage: Try changing one of the constructors in the loop to not redirect.
hasPublishedDocs: true
comment: |-
- No parameters.
-
TODO(scheglov): review this later, there are no explicit "it is a
compile-time error" in specification. But it was added to the co19 and
there is same error for factories.
https://code.google.com/p/dart/issues/detail?id=954
+
+ No parameters.
documentation: |-
#### Description
@@ -14503,7 +14586,8 @@
comment: |-
Parameters:
0: the name of the redirecting constructor
- 1: the name of the abstract class defining the constructor being redirected to
+ 1: the name of the abstract class defining the constructor being
+ redirected to
documentation: |-
#### Description
@@ -15508,6 +15592,7 @@
problemMessage: "Constant values from a deferred library can't be spread into a const literal."
correctionMessage: Try making the deferred import non-deferred.
hasPublishedDocs: false
+ comment: No parameters.
STATIC_ACCESS_TO_INSTANCE_MEMBER:
problemMessage: "Instance member '{0}' can't be accessed using static access."
hasPublishedDocs: true
@@ -16024,6 +16109,8 @@
7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time error if a generative constructor of class Object
includes a superinitializer.
+
+ No parameters.
SUPER_INVOCATION_NOT_LAST:
previousName: INVALID_SUPER_INVOCATION
problemMessage: "The superconstructor call must be last in an initializer list: '{0}'."
@@ -16591,11 +16678,11 @@
correctionMessage: "Try using a type that is the same as or a subclass of '{1}'."
hasPublishedDocs: true
comment: |-
+ See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
+
Parameters:
0: the name of the type parameter
1: the name of the bounding type
-
- See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
documentation: |-
#### Description
@@ -16732,11 +16819,13 @@
problemMessage: "A nullable expression can't be used in a spread."
correctionMessage: "Try checking that the value isn't 'null' before using it in a spread, or use a null-aware spread."
hasPublishedDocs: true
+ comment: No parameters.
UNCHECKED_INVOCATION_OF_NULLABLE_VALUE:
sharedName: UNCHECKED_USE_OF_NULLABLE_VALUE
problemMessage: "The function can't be unconditionally invoked because it can be 'null'."
correctionMessage: "Try adding a null check ('!')."
hasPublishedDocs: true
+ comment: No parameters.
UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE:
sharedName: UNCHECKED_USE_OF_NULLABLE_VALUE
problemMessage: "The method '{0}' can't be unconditionally invoked because the receiver can be 'null'."
@@ -16758,11 +16847,13 @@
problemMessage: "A nullable expression can't be used in a yield-each statement."
correctionMessage: "Try checking that the value isn't 'null' before using it in a yield-each statement."
hasPublishedDocs: true
+ comment: No parameters.
UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION:
sharedName: UNCHECKED_USE_OF_NULLABLE_VALUE
problemMessage: "A nullable expression can't be used as a condition."
correctionMessage: "Try checking that the value isn't 'null' before using it as a condition."
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -16824,6 +16915,7 @@
problemMessage: "A nullable expression can't be used as an iterator in a for-in loop."
correctionMessage: "Try checking that the value isn't 'null' before using it as an iterator."
hasPublishedDocs: true
+ comment: No parameters.
UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE:
sharedName: UNCHECKED_USE_OF_NULLABLE_VALUE
problemMessage: "The property '{0}' can't be unconditionally accessed because the receiver can be 'null'."
@@ -17143,6 +17235,7 @@
problemMessage: The enum doesn't have an unnamed constructor.
correctionMessage: Try adding the name of an existing constructor, or defining an unnamed constructor.
hasPublishedDocs: true
+ comment: No parameters.
UNDEFINED_EXTENSION_GETTER:
problemMessage: "The getter '{0}' isn't defined for the extension '{1}'."
correctionMessage: "Try correcting the name to the name of an existing getter, or defining a getter named '{0}'."
@@ -18219,6 +18312,7 @@
problemMessage: A member named 'values' can't be declared in an enum.
correctionMessage: Try using a different name.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -18310,8 +18404,8 @@
Parameters:
0: the name of the type parameter
1: the variance modifier defined for {0}
- 2: the variance position of the type parameter {0} in the
- superinterface {3}
+ 2: the variance position of the type parameter {0} in the superinterface
+ {3}
3: the name of the superinterface
WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR:
problemMessage: "Operator '{0}' should declare exactly {1} parameters, but {2} found."
@@ -19225,7 +19319,7 @@
problemMessage: "Argument to 'Native.addressOf' must be annotated with @Native"
correctionMessage: "Try passing a static function or field annotated with '@Native'"
hasPublishedDocs: true
- comment: No parameters
+ comment: No parameters.
documentation: |-
#### Description
@@ -19352,7 +19446,7 @@
problemMessage: "The native type of this field could not be inferred and must be specified in the annotation."
correctionMessage: "Try adding a type parameter extending `NativeType` to the `@Native` annotation."
hasPublishedDocs: true
- comment: "No parameters"
+ comment: "No parameters."
documentation: |-
#### Description
@@ -19396,7 +19490,7 @@
problemMessage: "Native fields must be static."
correctionMessage: "Try adding the modifier 'static' to this field."
hasPublishedDocs: true
- comment: "No parameters"
+ comment: "No parameters."
documentation: |-
#### Description
@@ -19463,7 +19557,7 @@
problemMessage: The native type of this function couldn't be inferred so it must be specified in the annotation.
correctionMessage: Try adding a type parameter extending `NativeType` to the `@Native` annotation.
hasPublishedDocs: true
- comment: No parameters
+ comment: No parameters.
documentation: |-
#### Description
@@ -19919,7 +20013,7 @@
problemMessage: "There may be at most one @DefaultAsset annotation on a library."
correctionMessage: "Try removing the extra annotation."
hasPublishedDocs: true
- comment: No parameters
+ comment: No parameters.
documentation: |-
#### Description
@@ -19953,7 +20047,7 @@
problemMessage: "Native functions and fields must have exactly one `@Native` annotation."
correctionMessage: "Try removing the extra annotation."
hasPublishedDocs: true
- comment: No parameters
+ comment: No parameters.
documentation: |-
#### Description
@@ -21352,10 +21446,10 @@
correctionMessage: Try replacing the colon with an equal sign.
hasPublishedDocs: true
comment: |-
- No parameters.
-
Note: Since this diagnostic is only produced in pre-3.0 code, we do not
plan to go through the exercise of converting it to a Warning.
+
+ No parameters.
documentation: |-
#### Description
@@ -21422,11 +21516,11 @@
correctionMessage: Try replacing the use of the deprecated member with the replacement.
hasPublishedDocs: true
comment: |-
- Parameters:
- 0: the name of the member
-
This code is deprecated in favor of the
'deprecated_member_from_same_package' lint rule, and will be removed.
+
+ Parameters:
+ 0: the name of the member
documentation: |-
#### Description
@@ -21454,12 +21548,12 @@
correctionMessage: Try replacing the use of the deprecated member with the replacement.
hasPublishedDocs: true
comment: |-
+ This code is deprecated in favor of the
+ 'deprecated_member_from_same_package' lint rule, and will be removed.
+
Parameters:
0: the name of the member
1: message details
-
- This code is deprecated in favor of the
- 'deprecated_member_from_same_package' lint rule, and will be removed.
DIVISION_OPTIMIZATION:
removedIn: "3.5"
problemMessage: The operator x ~/ y is more efficient than (x / y).toInt().
@@ -21665,11 +21759,16 @@
comment: |-
A code indicating that the camera permissions is not supported on Chrome
OS.
+
+ No parameters.
NON_RESIZABLE_ACTIVITY:
problemMessage: The `<activity>` element should be allowed to be resized to allow users to take advantage of the multi-window environment on Chrome OS
correctionMessage: Consider declaring the corresponding activity element with `resizableActivity="true"` attribute.
hasPublishedDocs: false
- comment: A code indicating that the activity is set to be non resizable.
+ comment: |-
+ A code indicating that the activity is set to be non resizable.
+
+ No parameters.
NO_TOUCHSCREEN_FEATURE:
problemMessage: 'The default "android.hardware.touchscreen" needs to be optional for Chrome OS. '
correctionMessage: 'Consider adding <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> to the manifest.'
@@ -21677,6 +21776,8 @@
comment: |-
A code indicating that the touchscreen feature is not specified in the
manifest.
+
+ No parameters.
PERMISSION_IMPLIES_UNSUPPORTED_HARDWARE:
problemMessage: "Permission makes app incompatible for Chrome OS, consider adding optional {0} feature tag, "
correctionMessage: ' Try adding `<uses-feature android:name="{0}" android:required="false">`.'
@@ -21691,7 +21792,10 @@
problemMessage: The `<activity>` element should not be locked to any orientation so that users can take advantage of the multi-window environments and larger screens on Chrome OS
correctionMessage: Consider declaring the corresponding activity element with `screenOrientation="unspecified"` or `"fullSensor"` attribute.
hasPublishedDocs: false
- comment: A code indicating that the activity is locked to an orientation.
+ comment: |-
+ A code indicating that the activity is locked to an orientation.
+
+ No parameters.
UNSUPPORTED_CHROME_OS_FEATURE:
problemMessage: "The feature {0} isn't supported on Chrome OS, consider making it optional."
correctionMessage: 'Try changing to `android:required="false"` for this feature.'
@@ -21716,6 +21820,7 @@
problemMessage: "Static methods can't be declared to be 'abstract'."
correctionMessage: "Try removing the keyword 'abstract'."
hasPublishedDocs: false
+ comment: No parameters.
ASYNC_KEYWORD_USED_AS_IDENTIFIER:
problemMessage: "The keywords 'await' and 'yield' can't be used as identifiers in an asynchronous or generator function."
hasPublishedDocs: false
@@ -21723,14 +21828,18 @@
16.32 Identifier Reference: It is a compile-time error if any of the
identifiers async, await, or yield is used as an identifier in a function
body marked with either async, async, or sync.
+
+ No parameters.
CONST_CONSTRUCTOR_WITH_BODY:
problemMessage: "Const constructors can't have a body."
correctionMessage: "Try removing either the 'const' keyword or the body."
hasPublishedDocs: false
+ comment: No parameters.
COVARIANT_CONSTRUCTOR:
problemMessage: "A constructor can't be declared to be 'covariant'."
correctionMessage: "Try removing the keyword 'covariant'."
hasPublishedDocs: false
+ comment: No parameters.
DEFAULT_VALUE_IN_FUNCTION_TYPE:
problemMessage: "Parameters in a function type can't have default values."
correctionMessage: Try removing the default value.
@@ -21766,53 +21875,65 @@
problemMessage: An enum must declare at least one constant name.
correctionMessage: Try declaring a constant.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_CASE_OR_DEFAULT:
problemMessage: "Expected 'case' or 'default'."
correctionMessage: Try placing this code inside a case clause.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_CLASS_MEMBER:
problemMessage: Expected a class member.
correctionMessage: Try placing this code inside a class member.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_EXECUTABLE:
problemMessage: Expected a method, getter, setter or operator declaration.
correctionMessage: This appears to be incomplete code. Try removing it or completing it.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_LIST_OR_MAP_LITERAL:
problemMessage: Expected a list or map literal.
correctionMessage: Try inserting a list or map literal, or remove the type arguments.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_NAMED_TYPE_EXTENDS:
sharedName: EXPECTED_NAMED_TYPE
problemMessage: Expected a class name.
correctionMessage: Try using a class name, possibly with type arguments.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_NAMED_TYPE_IMPLEMENTS:
sharedName: EXPECTED_NAMED_TYPE
problemMessage: Expected the name of a class or mixin.
correctionMessage: Try using a class or mixin name, possibly with type arguments.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_NAMED_TYPE_ON:
sharedName: EXPECTED_NAMED_TYPE
problemMessage: Expected the name of a class or mixin.
correctionMessage: Try using a class or mixin name, possibly with type arguments.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_NAMED_TYPE_WITH:
sharedName: EXPECTED_NAMED_TYPE
problemMessage: Expected a mixin name.
correctionMessage: Try using a mixin name, possibly with type arguments.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_REPRESENTATION_FIELD:
problemMessage: Expected a representation field.
correctionMessage: Try providing the representation field for this extension type.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_REPRESENTATION_TYPE:
problemMessage: Expected a representation type.
correctionMessage: Try providing the representation type for this extension type.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_STRING_LITERAL:
problemMessage: Expected a string literal.
hasPublishedDocs: false
+ comment: No parameters.
EXPECTED_TOKEN:
problemMessage: "Expected to find '{0}'."
hasPublishedDocs: false
@@ -21822,42 +21943,52 @@
EXPECTED_TYPE_NAME:
problemMessage: Expected a type name.
hasPublishedDocs: false
+ comment: No parameters.
EXTERNAL_GETTER_WITH_BODY:
problemMessage: "External getters can't have a body."
correctionMessage: "Try removing the body of the getter, or removing the keyword 'external'."
hasPublishedDocs: false
+ comment: No parameters.
EXTERNAL_OPERATOR_WITH_BODY:
problemMessage: "External operators can't have a body."
correctionMessage: "Try removing the body of the operator, or removing the keyword 'external'."
hasPublishedDocs: false
+ comment: No parameters.
EXTERNAL_SETTER_WITH_BODY:
problemMessage: "External setters can't have a body."
correctionMessage: "Try removing the body of the setter, or removing the keyword 'external'."
hasPublishedDocs: false
+ comment: No parameters.
FACTORY_WITHOUT_BODY:
problemMessage: "A non-redirecting 'factory' constructor must have a body."
correctionMessage: Try adding a body to the constructor.
hasPublishedDocs: false
+ comment: No parameters.
FACTORY_WITH_INITIALIZERS:
problemMessage: "A 'factory' constructor can't have initializers."
correctionMessage: "Try removing the 'factory' keyword to make this a generative constructor, or removing the initializers."
hasPublishedDocs: false
+ comment: No parameters.
FINAL_CONSTRUCTOR:
problemMessage: "A constructor can't be declared to be 'final'."
correctionMessage: "Try removing the keyword 'final'."
hasPublishedDocs: false
+ comment: No parameters.
FINAL_METHOD:
problemMessage: "Getters, setters and methods can't be declared to be 'final'."
correctionMessage: "Try removing the keyword 'final'."
hasPublishedDocs: false
+ comment: No parameters.
GETTER_IN_FUNCTION:
problemMessage: "Getters can't be defined within methods or functions."
correctionMessage: Try moving the getter outside the method or function, or converting the getter to a function.
hasPublishedDocs: false
+ comment: No parameters.
GETTER_WITH_PARAMETERS:
problemMessage: Getters must be declared without a parameter list.
correctionMessage: "Try removing the parameter list, or removing the keyword 'get' to define a method rather than a getter."
hasPublishedDocs: false
+ comment: No parameters.
INVALID_CODE_POINT:
problemMessage: "The escape sequence '{0}' isn't a valid code point."
hasPublishedDocs: false
@@ -21867,91 +21998,111 @@
INVALID_COMMENT_REFERENCE:
problemMessage: "Comment references should contain a possibly prefixed identifier and can start with 'new', but shouldn't contain anything else."
hasPublishedDocs: false
+ comment: No parameters.
INVALID_GENERIC_FUNCTION_TYPE:
problemMessage: Invalid generic function type.
correctionMessage: "Try using a generic function type (returnType 'Function(' parameters ')')."
hasPublishedDocs: false
+ comment: No parameters.
INVALID_LITERAL_IN_CONFIGURATION:
problemMessage: "The literal in a configuration can't contain interpolation."
correctionMessage: Try removing the interpolation expressions.
hasPublishedDocs: false
+ comment: No parameters.
INVALID_OPERATOR_FOR_SUPER:
problemMessage: "The operator '{0}' can't be used with 'super'."
hasPublishedDocs: false
comment: |-
- Parameters:
- 0: the operator being applied to 'super'
-
Only generated by the old parser.
Replaced by INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER.
+
+ Parameters:
+ 0: the operator being applied to 'super'
INVALID_STAR_AFTER_ASYNC:
problemMessage: "The modifier 'async*' isn't allowed for an expression function body."
correctionMessage: Try converting the body to a block.
hasPublishedDocs: false
+ comment: No parameters.
INVALID_SYNC:
problemMessage: "The modifier 'sync' isn't allowed for an expression function body."
correctionMessage: Try converting the body to a block.
hasPublishedDocs: false
+ comment: No parameters.
INVALID_USE_OF_IDENTIFIER_AUGMENTED:
experiment: augmentations
problemMessage: The identifier 'augmented' can only be used to reference the augmented declaration inside an augmentation.
correctionMessage: Try using a different identifier.
hasPublishedDocs: false
+ comment: No parameters.
LOCAL_FUNCTION_DECLARATION_MODIFIER:
problemMessage: "Local function declarations can't specify any modifiers."
correctionMessage: Try removing the modifier.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_CLOSING_PARENTHESIS:
problemMessage: The closing parenthesis is missing.
correctionMessage: Try adding the closing parenthesis.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_ENUM_BODY:
problemMessage: An enum definition must have a body with at least one constant name.
correctionMessage: Try adding a body and defining at least one constant.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_EXPRESSION_IN_INITIALIZER:
problemMessage: Expected an expression after the assignment operator.
correctionMessage: Try adding the value to be assigned, or remove the assignment operator.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_FUNCTION_BODY:
problemMessage: A function body must be provided.
correctionMessage: Try adding a function body.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_FUNCTION_KEYWORD:
problemMessage: "Function types must have the keyword 'Function' before the parameter list."
correctionMessage: "Try adding the keyword 'Function'."
hasPublishedDocs: false
+ comment: No parameters.
MISSING_FUNCTION_PARAMETERS:
problemMessage: Functions must have an explicit list of parameters.
correctionMessage: Try adding a parameter list.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_GET:
problemMessage: "Getters must have the keyword 'get' before the getter name."
correctionMessage: "Try adding the keyword 'get'."
hasPublishedDocs: false
+ comment: No parameters.
MISSING_IDENTIFIER:
problemMessage: Expected an identifier.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_METHOD_PARAMETERS:
problemMessage: Methods must have an explicit list of parameters.
correctionMessage: Try adding a parameter list.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_NAME_FOR_NAMED_PARAMETER:
problemMessage: Named parameters in a function type must have a name
correctionMessage: Try providing a name for the parameter or removing the curly braces.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_NAME_IN_LIBRARY_DIRECTIVE:
problemMessage: Library directives must include a library name.
correctionMessage: "Try adding a library name after the keyword 'library', or remove the library directive if the library doesn't have any parts."
hasPublishedDocs: false
+ comment: No parameters.
MISSING_NAME_IN_PART_OF_DIRECTIVE:
problemMessage: Part-of directives must include a library name.
correctionMessage: "Try adding a library name after the 'of'."
hasPublishedDocs: false
+ comment: No parameters.
MISSING_STAR_AFTER_SYNC:
problemMessage: "The modifier 'sync' must be followed by a star ('*')."
correctionMessage: Try removing the modifier, or add a star.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_TERMINATOR_FOR_PARAMETER_GROUP:
problemMessage: "There is no '{0}' to close the parameter group."
correctionMessage: "Try inserting a '{0}' at the end of the group."
@@ -21963,30 +22114,37 @@
problemMessage: Typedefs must have an explicit list of parameters.
correctionMessage: Try adding a parameter list.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_VARIABLE_IN_FOR_EACH:
problemMessage: "A loop variable must be declared in a for-each loop before the 'in', but none was found."
correctionMessage: Try declaring a loop variable.
hasPublishedDocs: false
+ comment: No parameters.
MIXED_PARAMETER_GROUPS:
problemMessage: "Can't have both positional and named parameters in a single parameter list."
correctionMessage: Try choosing a single style of optional parameters.
hasPublishedDocs: false
+ comment: No parameters.
MULTIPLE_IMPLEMENTS_CLAUSES:
problemMessage: Each class or mixin definition can have at most one implements clause.
correctionMessage: Try combining all of the implements clauses into a single clause.
hasPublishedDocs: false
+ comment: No parameters.
MULTIPLE_NAMED_PARAMETER_GROUPS:
problemMessage: "Can't have multiple groups of named parameters in a single parameter list."
correctionMessage: Try combining all of the groups into a single group.
hasPublishedDocs: false
+ comment: No parameters.
MULTIPLE_POSITIONAL_PARAMETER_GROUPS:
problemMessage: "Can't have multiple groups of positional parameters in a single parameter list."
correctionMessage: Try combining all of the groups into a single group.
hasPublishedDocs: false
+ comment: No parameters.
MULTIPLE_REPRESENTATION_FIELDS:
problemMessage: Each extension type should have exactly one representation field.
correctionMessage: Try combining fields into a record, or removing extra fields.
hasPublishedDocs: false
+ comment: No parameters.
MULTIPLE_VARIABLES_IN_FOR_EACH:
problemMessage: "A single loop variable must be declared in a for-each loop before the 'in', but {0} were found."
correctionMessage: Try moving all but one of the declarations inside the loop body.
@@ -21998,38 +22156,47 @@
problemMessage: "Function expressions can't be named."
correctionMessage: Try removing the name, or moving the function expression to a function declaration statement.
hasPublishedDocs: false
+ comment: No parameters.
NAMED_FUNCTION_TYPE:
problemMessage: "Function types can't be named."
correctionMessage: "Try replacing the name with the keyword 'Function'."
hasPublishedDocs: false
+ comment: No parameters.
NAMED_PARAMETER_OUTSIDE_GROUP:
problemMessage: "Named parameters must be enclosed in curly braces ('{' and '}')."
correctionMessage: Try surrounding the named parameters in curly braces.
hasPublishedDocs: false
+ comment: No parameters.
NATIVE_CLAUSE_IN_NON_SDK_CODE:
problemMessage: Native clause can only be used in the SDK and code that is loaded through native extensions.
correctionMessage: Try removing the native clause.
hasPublishedDocs: false
+ comment: No parameters.
NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE:
problemMessage: Native functions can only be declared in the SDK and code that is loaded through native extensions.
correctionMessage: "Try removing the word 'native'."
hasPublishedDocs: false
+ comment: No parameters.
NON_CONSTRUCTOR_FACTORY:
problemMessage: Only a constructor can be declared to be a factory.
correctionMessage: "Try removing the keyword 'factory'."
hasPublishedDocs: false
+ comment: No parameters.
NON_IDENTIFIER_LIBRARY_NAME:
problemMessage: The name of a library must be an identifier.
correctionMessage: Try using an identifier as the name of the library.
hasPublishedDocs: false
+ comment: No parameters.
NON_PART_OF_DIRECTIVE_IN_PART:
problemMessage: The part-of directive must be the only directive in a part.
correctionMessage: Try removing the other directives, or moving them to the library for which this is a part.
hasPublishedDocs: false
+ comment: No parameters.
NON_STRING_LITERAL_AS_URI:
problemMessage: The URI must be a string literal.
correctionMessage: Try enclosing the URI in either single or double quotes.
hasPublishedDocs: false
+ comment: No parameters.
NON_USER_DEFINABLE_OPERATOR:
problemMessage: "The operator '{0}' isn't user definable."
hasPublishedDocs: false
@@ -22040,38 +22207,47 @@
problemMessage: Normal parameters must occur before optional parameters.
correctionMessage: Try moving all of the normal parameters before the optional parameters.
hasPublishedDocs: false
+ comment: No parameters.
PART_OF_NAME:
problemMessage: "The 'part of' directive can't use a name with the enhanced-parts feature."
correctionMessage: "Try using 'part of' with a URI instead."
hasPublishedDocs: false
+ comment: No parameters.
POSITIONAL_AFTER_NAMED_ARGUMENT:
problemMessage: Positional arguments must occur before named arguments.
correctionMessage: Try moving all of the positional arguments before the named arguments.
hasPublishedDocs: false
+ comment: No parameters.
POSITIONAL_PARAMETER_OUTSIDE_GROUP:
problemMessage: "Positional parameters must be enclosed in square brackets ('[' and ']')."
correctionMessage: Try surrounding the positional parameters in square brackets.
hasPublishedDocs: false
+ comment: No parameters.
REPRESENTATION_FIELD_MODIFIER:
problemMessage: "Representation fields can't have modifiers."
correctionMessage: Try removing the modifier.
hasPublishedDocs: false
+ comment: No parameters.
REPRESENTATION_FIELD_TRAILING_COMMA:
problemMessage: The representation field can't have a trailing comma.
correctionMessage: Try removing the trailing comma.
hasPublishedDocs: false
+ comment: No parameters.
SETTER_IN_FUNCTION:
problemMessage: "Setters can't be defined within methods or functions."
correctionMessage: Try moving the setter outside the method or function.
hasPublishedDocs: false
+ comment: No parameters.
STATIC_GETTER_WITHOUT_BODY:
problemMessage: "A 'static' getter must have a body."
correctionMessage: "Try adding a body to the getter, or removing the keyword 'static'."
hasPublishedDocs: false
+ comment: No parameters.
STATIC_SETTER_WITHOUT_BODY:
problemMessage: "A 'static' setter must have a body."
correctionMessage: "Try adding a body to the setter, or removing the keyword 'static'."
hasPublishedDocs: false
+ comment: No parameters.
UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP:
problemMessage: "There is no '{0}' to open a parameter group."
correctionMessage: "Try inserting the '{0}' at the appropriate location."
@@ -22090,17 +22266,21 @@
problemMessage: "Classes can't be declared to be 'var'."
correctionMessage: "Try removing the keyword 'var'."
hasPublishedDocs: false
+ comment: No parameters.
VAR_ENUM:
problemMessage: "Enums can't be declared to be 'var'."
correctionMessage: "Try removing the keyword 'var'."
hasPublishedDocs: false
+ comment: No parameters.
VAR_TYPEDEF:
problemMessage: "Typedefs can't be declared to be 'var'."
correctionMessage: "Try removing the keyword 'var', or replacing it with the name of the return type."
hasPublishedDocs: false
+ comment: No parameters.
WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER:
problemMessage: Setters must declare exactly one required positional parameter.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -22141,6 +22321,7 @@
problemMessage: "The default value of a positional parameter should be preceded by '='."
correctionMessage: "Try replacing the ':' with '='."
hasPublishedDocs: false
+ comment: No parameters.
WRONG_TERMINATOR_FOR_PARAMETER_GROUP:
problemMessage: "Expected '{0}' to close parameter group."
correctionMessage: "Try replacing '{0}' with '{1}'."
@@ -22293,10 +22474,10 @@
correctionMessage: Try converting the value to be a string.
hasPublishedDocs: true
comment: |-
- No parameters.
-
This code is deprecated in favor of the
'ASSET_NOT_STRING_OR_MAP' code, and will be removed.
+
+ No parameters.
documentation: |-
#### Description
@@ -22750,7 +22931,8 @@
comment: |-
Parameters:
0: the list of packages missing from the dependencies and the list of
- packages missing from the dev_dependencies (if any) in the pubspec file.
+ packages missing from the dev_dependencies (if any) in the pubspec
+ file.
documentation: |-
#### Description
@@ -23076,15 +23258,19 @@
MISSING_DIGIT:
problemMessage: Decimal digit expected.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_HEX_DIGIT:
problemMessage: Hexadecimal digit expected.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_IDENTIFIER:
problemMessage: Expected an identifier.
hasPublishedDocs: false
+ comment: No parameters.
MISSING_QUOTE:
problemMessage: Expected quote (' or ").
hasPublishedDocs: false
+ comment: No parameters.
UNABLE_GET_CONTENT:
problemMessage: Unable to get content of '{0}'.
hasPublishedDocs: false
@@ -23095,10 +23281,12 @@
problemMessage: A '$' has special meaning inside a string, and must be followed by an identifier or an expression in curly braces ({}).
hasPublishedDocs: false
correctionMessage: Try adding a backslash (\) to escape the '$'.
+ comment: No parameters.
UNEXPECTED_SEPARATOR_IN_NUMBER:
problemMessage: Digit separators ('_') in a number literal can only be placed between two digits.
hasPublishedDocs: false
correctionMessage: Try removing the '_'.
+ comment: No parameters.
UNSUPPORTED_OPERATOR:
problemMessage: The '{0}' operator is not supported.
hasPublishedDocs: false
@@ -23109,9 +23297,11 @@
problemMessage: Unterminated multi-line comment.
hasPublishedDocs: false
correctionMessage: Try terminating the comment with '*/', or removing any unbalanced occurrences of '/*' (because comments nest in Dart).
+ comment: No parameters.
UNTERMINATED_STRING_LITERAL:
problemMessage: Unterminated string literal.
hasPublishedDocs: false
+ comment: No parameters.
StaticWarningCode:
DEAD_NULL_AWARE_EXPRESSION:
problemMessage: "The left operand can't be null, so the right operand is never executed."
@@ -24265,6 +24455,7 @@
problemMessage: "Doc directive is missing a closing curly brace ('}')."
correctionMessage: "Try closing the directive with a curly brace."
hasPublishedDocs: false
+ comment: No parameters.
DOC_DIRECTIVE_MISSING_CLOSING_TAG:
problemMessage: "Doc directive is missing a closing tag."
correctionMessage: "Try closing the directive with the appropriate closing tag, '{0}'."
@@ -24328,6 +24519,7 @@
problemMessage: "Doc imports can't be deferred."
correctionMessage: Try removing the 'deferred' keyword.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -24360,6 +24552,7 @@
problemMessage: "Doc imports can't have show or hide combinators."
correctionMessage: Try removing the combinator.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -24390,6 +24583,7 @@
problemMessage: "Doc imports can't have configurations."
correctionMessage: Try removing the configurations.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -24420,6 +24614,7 @@
problemMessage: "Doc imports can't have prefixes."
correctionMessage: Try removing the prefix.
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -25017,8 +25212,9 @@
hasPublishedDocs: true
comment: |-
Parameters:
- 0: the name of the element
- 1: ?
+ 0: the name of the internal element
+ 1: the name of the exported element that indirectly exposes the internal
+ element
documentation: |-
#### Description
@@ -25249,6 +25445,7 @@
problemMessage: The language version override must be specified before any declaration or directive.
correctionMessage: Try moving the language version override to the top of the file.
hasPublishedDocs: true
+ comment: No parameters.
INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE:
sharedName: INVALID_LANGUAGE_VERSION_OVERRIDE
problemMessage: "The Dart language version override comment must be specified with the word 'dart' in all lower case."
@@ -25356,7 +25553,7 @@
This warning is generated anywhere where `@nonVirtual` annotates something
other than a non-abstract instance member in a class or mixin.
- No Parameters.
+ No parameters.
documentation: |-
#### Description
@@ -26094,6 +26291,7 @@
INVALID_WIDGET_PREVIEW_APPLICATION:
problemMessage: "The '@Preview(...)' annotation can only be applied to public, statically accessible constructors and functions."
hasPublishedDocs: true
+ comment: No parameters.
documentation: |-
#### Description
@@ -26944,7 +27142,7 @@
dead or unreachable code are encouraged to indicate that any arguments to
the call are unreachable.
- Parameters: none
+ No parameters.
REDECLARE_ON_NON_REDECLARING_MEMBER:
problemMessage: "The {0} doesn't redeclare a {0} declared in a superinterface."
correctionMessage: Try updating this member to match a declaration in a superinterface, or removing the redeclare annotation.
@@ -27253,12 +27451,12 @@
correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to 2.15 or higher, and running 'pub get'."
hasPublishedDocs: true
comment: |-
- No parameters.
-
There is also a [ParserErrorCode.EXPERIMENT_NOT_ENABLED] code which
catches some cases of constructor tearoff features (like
`List<int>.filled;`). Other constructor tearoff cases are not realized
until resolution (like `List.filled;`).
+
+ No parameters.
documentation: |-
#### Description
diff --git a/pkg/analyzer_plugin/api.txt b/pkg/analyzer_plugin/api.txt
index 723b419..99172cf 100644
--- a/pkg/analyzer_plugin/api.txt
+++ b/pkg/analyzer_plugin/api.txt
@@ -1628,11 +1628,11 @@
addAssist (method: void Function(AssistKind, ChangeBuilder, {List<Object>? args}))
package:analyzer_plugin/utilities/change_builder/change_builder_core.dart:
ChangeBuilder (class extends Object):
- new (constructor: ChangeBuilder Function({String? defaultEol, String? eol, AnalysisSession session, ChangeWorkspace workspace}))
+ new (constructor: ChangeBuilder Function({String? defaultEol, deprecated String? eol, AnalysisSession session, ChangeWorkspace workspace}))
defaultEol (getter: String)
selectionRange (getter: SourceRange?)
sourceChange (getter: SourceChange)
- addDartFileEdit (method: Future<void> Function(String, FutureOr<void> Function(DartFileEditBuilder), {bool createEditsForImports, String Function(Uri) importPrefixGenerator}))
+ addDartFileEdit (method: Future<void> Function(String, FutureOr<void> Function(DartFileEditBuilder), {bool createEditsForImports, deprecated String Function(Uri) importPrefixGenerator}))
addGenericFileEdit (method: Future<void> Function(String, void Function(FileEditBuilder)))
addYamlFileEdit (method: Future<void> Function(String, void Function(YamlFileEditBuilder)))
copy (method: ChangeBuilder Function(), deprecated)
diff --git a/pkg/analyzer_utilities/lib/tool/api.dart b/pkg/analyzer_utilities/lib/tool/api.dart
index 049e5ac..e2d2d7b 100644
--- a/pkg/analyzer_utilities/lib/tool/api.dart
+++ b/pkg/analyzer_utilities/lib/tool/api.dart
@@ -148,13 +148,20 @@
for (var formalParameter in formalParameters) {
if (formalParameter.isNamed) {
namedParams[formalParameter.name!] = [
+ if (formalParameter.isDeprecated) 'deprecated ',
if (formalParameter.isRequired) 'required ',
..._describeType(formalParameter.type),
];
} else if (formalParameter.isOptional) {
- optionalParams.add(_describeType(formalParameter.type));
+ optionalParams.add([
+ if (formalParameter.isDeprecated) 'deprecated ',
+ ..._describeType(formalParameter.type),
+ ]);
} else {
- params.add(_describeType(formalParameter.type));
+ params.add([
+ if (formalParameter.isDeprecated) 'deprecated ',
+ ..._describeType(formalParameter.type),
+ ]);
}
}
if (optionalParams.isNotEmpty) {
@@ -675,6 +682,13 @@
}
}
+extension on FormalParameterElement {
+ bool get isDeprecated {
+ // TODO(paulberry): add this to the analyzer public API
+ return metadata.hasDeprecated;
+ }
+}
+
extension on String {
bool get isPublic => !startsWith('_');
}
diff --git a/pkg/linter/lib/src/lint_codes.g.dart b/pkg/linter/lib/src/lint_codes.g.dart
index c5849ae..a0c0bf3 100644
--- a/pkg/linter/lib/src/lint_codes.g.dart
+++ b/pkg/linter/lib/src/lint_codes.g.dart
@@ -20,6 +20,8 @@
import 'analyzer.dart';
class LinterLintCode extends LintCode {
+ /// Parameters:
+ /// 0: undocumented
static const LintCode always_declare_return_types_of_functions =
LinterLintCode(
LintNames.always_declare_return_types,
@@ -29,6 +31,8 @@
uniqueName: 'always_declare_return_types_of_functions',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode always_declare_return_types_of_methods = LinterLintCode(
LintNames.always_declare_return_types,
"The method '{0}' should have a return type but doesn't.",
@@ -37,6 +41,7 @@
uniqueName: 'always_declare_return_types_of_methods',
);
+ /// No parameters.
static const LintCode always_put_control_body_on_new_line = LinterLintCode(
LintNames.always_put_control_body_on_new_line,
"Statement should be on a separate line.",
@@ -44,6 +49,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode always_put_required_named_parameters_first =
LinterLintCode(
LintNames.always_put_required_named_parameters_first,
@@ -54,6 +60,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode always_specify_types_add_type = LinterLintCode(
LintNames.always_specify_types,
"Missing type annotation.",
@@ -61,6 +68,9 @@
uniqueName: 'always_specify_types_add_type',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode always_specify_types_replace_keyword = LinterLintCode(
LintNames.always_specify_types,
"Missing type annotation.",
@@ -68,6 +78,8 @@
uniqueName: 'always_specify_types_replace_keyword',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode always_specify_types_specify_type = LinterLintCode(
LintNames.always_specify_types,
"Missing type annotation.",
@@ -75,6 +87,7 @@
uniqueName: 'always_specify_types_specify_type',
);
+ /// No parameters.
static const LintCode always_specify_types_split_to_types = LinterLintCode(
LintNames.always_specify_types,
"Missing type annotation.",
@@ -84,6 +97,7 @@
uniqueName: 'always_specify_types_split_to_types',
);
+ /// No parameters.
static const LintCode always_use_package_imports = LinterLintCode(
LintNames.always_use_package_imports,
"Use 'package:' imports for files in the 'lib' directory.",
@@ -91,6 +105,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode annotate_overrides = LinterLintCode(
LintNames.annotate_overrides,
"The member '{0}' overrides an inherited member but isn't annotated with "
@@ -99,18 +115,22 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode annotate_redeclares = LinterLintCode(
LintNames.annotate_redeclares,
"The member '{0}' is redeclaring but isn't annotated with '@redeclare'.",
correctionMessage: "Try adding the '@redeclare' annotation.",
);
+ /// No parameters.
static const LintCode avoid_annotating_with_dynamic = LinterLintCode(
LintNames.avoid_annotating_with_dynamic,
"Unnecessary 'dynamic' type annotation.",
correctionMessage: "Try removing the type 'dynamic'.",
);
+ /// No parameters.
static const LintCode avoid_bool_literals_in_conditional_expressions =
LinterLintCode(
LintNames.avoid_bool_literals_in_conditional_expressions,
@@ -119,6 +139,7 @@
"Try rewriting the expression to use either '&&' or '||'.",
);
+ /// No parameters.
static const LintCode avoid_catches_without_on_clauses = LinterLintCode(
LintNames.avoid_catches_without_on_clauses,
"Catch clause should use 'on' to specify the type of exception being "
@@ -126,6 +147,7 @@
correctionMessage: "Try adding an 'on' clause before the 'catch'.",
);
+ /// No parameters.
static const LintCode avoid_catching_errors_class = LinterLintCode(
LintNames.avoid_catching_errors,
"The type 'Error' should not be caught.",
@@ -134,6 +156,8 @@
uniqueName: 'avoid_catching_errors_class',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode avoid_catching_errors_subclass = LinterLintCode(
LintNames.avoid_catching_errors,
"The type '{0}' should not be caught because it is a subclass of 'Error'.",
@@ -142,6 +166,7 @@
uniqueName: 'avoid_catching_errors_subclass',
);
+ /// No parameters.
static const LintCode avoid_classes_with_only_static_members = LinterLintCode(
LintNames.avoid_classes_with_only_static_members,
"Classes should define instance members.",
@@ -149,12 +174,14 @@
"Try adding instance behavior or moving the members out of the class.",
);
+ /// No parameters.
static const LintCode avoid_double_and_int_checks = LinterLintCode(
LintNames.avoid_double_and_int_checks,
"Explicit check for double or int.",
correctionMessage: "Try removing the check.",
);
+ /// No parameters.
static const LintCode avoid_dynamic_calls = LinterLintCode(
LintNames.avoid_dynamic_calls,
"Method invocation or property access on a 'dynamic' target.",
@@ -162,6 +189,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_empty_else = LinterLintCode(
LintNames.avoid_empty_else,
"Empty statements are not allowed in an 'else' clause.",
@@ -170,6 +198,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode
avoid_equals_and_hash_code_on_mutable_classes = LinterLintCode(
LintNames.avoid_equals_and_hash_code_on_mutable_classes,
@@ -179,12 +209,16 @@
"Try removing the override or annotating the class with '@immutable'.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode avoid_escaping_inner_quotes = LinterLintCode(
LintNames.avoid_escaping_inner_quotes,
"Unnecessary escape of '{0}'.",
correctionMessage: "Try changing the outer quotes to '{1}'.",
);
+ /// No parameters.
static const LintCode
avoid_field_initializers_in_const_classes = LinterLintCode(
LintNames.avoid_field_initializers_in_const_classes,
@@ -194,12 +228,14 @@
"constructors.",
);
+ /// No parameters.
static const LintCode avoid_final_parameters = LinterLintCode(
LintNames.avoid_final_parameters,
"Parameters should not be marked as 'final'.",
correctionMessage: "Try removing the keyword 'final'.",
);
+ /// No parameters.
static const LintCode avoid_function_literals_in_foreach_calls =
LinterLintCode(
LintNames.avoid_function_literals_in_foreach_calls,
@@ -208,6 +244,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_futureor_void = LinterLintCode(
LintNames.avoid_futureor_void,
"Don't use the type 'FutureOr<void>'.",
@@ -215,12 +252,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_implementing_value_types = LinterLintCode(
LintNames.avoid_implementing_value_types,
"Classes that override '==' should not be implemented.",
correctionMessage: "Try removing the class from the 'implements' clause.",
);
+ /// No parameters.
static const LintCode avoid_init_to_null = LinterLintCode(
LintNames.avoid_init_to_null,
"Redundant initialization to 'null'.",
@@ -228,12 +267,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_js_rounded_ints = LinterLintCode(
LintNames.avoid_js_rounded_ints,
"Integer literal can't be represented exactly when compiled to JavaScript.",
correctionMessage: "Try using a 'BigInt' to represent the value.",
);
+ /// No parameters.
static const LintCode avoid_multiple_declarations_per_line = LinterLintCode(
LintNames.avoid_multiple_declarations_per_line,
"Multiple variables declared on a single line.",
@@ -241,6 +282,7 @@
"Try splitting the variable declarations into multiple lines.",
);
+ /// No parameters.
static const LintCode avoid_null_checks_in_equality_operators =
LinterLintCode(
LintNames.avoid_null_checks_in_equality_operators,
@@ -248,12 +290,14 @@
correctionMessage: "Try removing the comparison.",
);
+ /// No parameters.
static const LintCode avoid_positional_boolean_parameters = LinterLintCode(
LintNames.avoid_positional_boolean_parameters,
"'bool' parameters should be named parameters.",
correctionMessage: "Try converting the parameter to a named parameter.",
);
+ /// No parameters.
static const LintCode avoid_print = LinterLintCode(
LintNames.avoid_print,
"Don't invoke 'print' in production code.",
@@ -261,12 +305,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_private_typedef_functions = LinterLintCode(
LintNames.avoid_private_typedef_functions,
"The typedef is unnecessary because it is only used in one place.",
correctionMessage: "Try inlining the type or using it in other places.",
);
+ /// No parameters.
static const LintCode avoid_redundant_argument_values = LinterLintCode(
LintNames.avoid_redundant_argument_values,
"The value of the argument is redundant because it matches the default "
@@ -274,6 +320,7 @@
correctionMessage: "Try removing the argument.",
);
+ /// No parameters.
static const LintCode avoid_relative_lib_imports = LinterLintCode(
LintNames.avoid_relative_lib_imports,
"Can't use a relative path to import a library in 'lib'.",
@@ -283,6 +330,9 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode avoid_renaming_method_parameters = LinterLintCode(
LintNames.avoid_renaming_method_parameters,
"The parameter name '{0}' doesn't match the name '{1}' in the overridden "
@@ -291,6 +341,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_return_types_on_setters = LinterLintCode(
LintNames.avoid_return_types_on_setters,
"Unnecessary return type on a setter.",
@@ -298,6 +349,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_returning_null_for_void_from_function =
LinterLintCode(
LintNames.avoid_returning_null_for_void,
@@ -307,6 +359,7 @@
uniqueName: 'avoid_returning_null_for_void_from_function',
);
+ /// No parameters.
static const LintCode avoid_returning_null_for_void_from_method =
LinterLintCode(
LintNames.avoid_returning_null_for_void,
@@ -316,6 +369,7 @@
uniqueName: 'avoid_returning_null_for_void_from_method',
);
+ /// No parameters.
static const LintCode avoid_returning_this = LinterLintCode(
LintNames.avoid_returning_this,
"Don't return 'this' from a method.",
@@ -323,6 +377,7 @@
"Try changing the return type to 'void' and removing the return.",
);
+ /// No parameters.
static const LintCode avoid_setters_without_getters = LinterLintCode(
LintNames.avoid_setters_without_getters,
"Setter has no corresponding getter.",
@@ -330,6 +385,9 @@
"Try adding a corresponding getter or removing the setter.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode avoid_shadowing_type_parameters = LinterLintCode(
LintNames.avoid_shadowing_type_parameters,
"The type parameter '{0}' shadows a type parameter from the enclosing {1}.",
@@ -337,6 +395,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode avoid_single_cascade_in_expression_statements =
LinterLintCode(
LintNames.avoid_single_cascade_in_expression_statements,
@@ -345,6 +405,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_slow_async_io = LinterLintCode(
LintNames.avoid_slow_async_io,
"Use of an async 'dart:io' method.",
@@ -352,6 +413,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode avoid_type_to_string = LinterLintCode(
LintNames.avoid_type_to_string,
"Using 'toString' on a 'Type' is not safe in production code.",
@@ -360,6 +422,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode
avoid_types_as_parameter_names_formal_parameter = LinterLintCode(
LintNames.avoid_types_as_parameter_names,
@@ -371,6 +435,8 @@
uniqueName: 'avoid_types_as_parameter_names_formal_parameter',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode
avoid_types_as_parameter_names_type_parameter = LinterLintCode(
LintNames.avoid_types_as_parameter_names,
@@ -381,12 +447,14 @@
uniqueName: 'avoid_types_as_parameter_names_type_parameter',
);
+ /// No parameters.
static const LintCode avoid_types_on_closure_parameters = LinterLintCode(
LintNames.avoid_types_on_closure_parameters,
"Unnecessary type annotation on a function expression parameter.",
correctionMessage: "Try removing the type annotation.",
);
+ /// No parameters.
static const LintCode avoid_unnecessary_containers = LinterLintCode(
LintNames.avoid_unnecessary_containers,
"Unnecessary instance of 'Container'.",
@@ -396,12 +464,15 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode avoid_unused_constructor_parameters = LinterLintCode(
LintNames.avoid_unused_constructor_parameters,
"The parameter '{0}' is not used in the constructor.",
correctionMessage: "Try using the parameter or removing it.",
);
+ /// No parameters.
static const LintCode avoid_void_async = LinterLintCode(
LintNames.avoid_void_async,
"An 'async' function should have a 'Future' return type when it doesn't "
@@ -409,6 +480,7 @@
correctionMessage: "Try changing the return type.",
);
+ /// No parameters.
static const LintCode avoid_web_libraries_in_flutter = LinterLintCode(
LintNames.avoid_web_libraries_in_flutter,
"Don't use web-only libraries outside Flutter web plugins.",
@@ -416,6 +488,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode await_only_futures = LinterLintCode(
LintNames.await_only_futures,
"Uses 'await' on an instance of '{0}', which is not a subtype of 'Future'.",
@@ -423,6 +497,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode camel_case_extensions = LinterLintCode(
LintNames.camel_case_extensions,
"The extension name '{0}' isn't an UpperCamelCase identifier.",
@@ -431,6 +507,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode camel_case_types = LinterLintCode(
LintNames.camel_case_types,
"The type name '{0}' isn't an UpperCamelCase identifier.",
@@ -439,6 +517,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode cancel_subscriptions = LinterLintCode(
LintNames.cancel_subscriptions,
"Uncancelled instance of 'StreamSubscription'.",
@@ -448,12 +527,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode cascade_invocations = LinterLintCode(
LintNames.cascade_invocations,
"Unnecessary duplication of receiver.",
correctionMessage: "Try using a cascade to avoid the duplication.",
);
+ /// No parameters.
static const LintCode cast_nullable_to_non_nullable = LinterLintCode(
LintNames.cast_nullable_to_non_nullable,
"Don't cast a nullable value to a non-nullable type.",
@@ -461,6 +542,7 @@
"Try adding a not-null assertion ('!') to make the type non-nullable.",
);
+ /// No parameters.
static const LintCode close_sinks = LinterLintCode(
LintNames.close_sinks,
"Unclosed instance of 'Sink'.",
@@ -469,6 +551,9 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode collection_methods_unrelated_type = LinterLintCode(
LintNames.collection_methods_unrelated_type,
"The argument type '{0}' isn't related to '{1}'.",
@@ -476,18 +561,22 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode combinators_ordering = LinterLintCode(
LintNames.combinators_ordering,
"Sort combinator names alphabetically.",
correctionMessage: "Try sorting the combinator names alphabetically.",
);
+ /// No parameters.
static const LintCode comment_references = LinterLintCode(
LintNames.comment_references,
"The referenced name isn't visible in scope.",
correctionMessage: "Try adding an import for the referenced name.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode conditional_uri_does_not_exist = LinterLintCode(
LintNames.conditional_uri_does_not_exist,
"The target of the conditional URI '{0}' doesn't exist.",
@@ -496,6 +585,8 @@
"file that does exist.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode constant_identifier_names = LinterLintCode(
LintNames.constant_identifier_names,
"The constant name '{0}' isn't a lowerCamelCase identifier.",
@@ -504,6 +595,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode control_flow_in_finally = LinterLintCode(
LintNames.control_flow_in_finally,
"Use of '{0}' in a 'finally' clause.",
@@ -511,6 +604,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode curly_braces_in_flow_control_structures =
LinterLintCode(
LintNames.curly_braces_in_flow_control_structures,
@@ -519,6 +614,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode dangling_library_doc_comments = LinterLintCode(
LintNames.dangling_library_doc_comments,
"Dangling library doc comment.",
@@ -526,6 +622,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode depend_on_referenced_packages = LinterLintCode(
LintNames.depend_on_referenced_packages,
"The imported package '{0}' isn't a dependency of the importing package.",
@@ -534,6 +632,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode deprecated_consistency_constructor = LinterLintCode(
LintNames.deprecated_consistency,
"Constructors in a deprecated class should be deprecated.",
@@ -541,6 +640,7 @@
uniqueName: 'deprecated_consistency_constructor',
);
+ /// No parameters.
static const LintCode deprecated_consistency_field = LinterLintCode(
LintNames.deprecated_consistency,
"Fields that are initialized by a deprecated parameter should be "
@@ -549,6 +649,7 @@
uniqueName: 'deprecated_consistency_field',
);
+ /// No parameters.
static const LintCode deprecated_consistency_parameter = LinterLintCode(
LintNames.deprecated_consistency,
"Parameters that initialize a deprecated field should be deprecated.",
@@ -556,6 +657,9 @@
uniqueName: 'deprecated_consistency_parameter',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
deprecated_member_use_from_same_package_with_message = LinterLintCode(
LintNames.deprecated_member_use_from_same_package,
@@ -566,6 +670,8 @@
uniqueName: 'deprecated_member_use_from_same_package_with_message',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode
deprecated_member_use_from_same_package_without_message = LinterLintCode(
LintNames.deprecated_member_use_from_same_package,
@@ -576,6 +682,7 @@
uniqueName: 'deprecated_member_use_from_same_package_without_message',
);
+ /// No parameters.
static const LintCode diagnostic_describe_all_properties = LinterLintCode(
LintNames.diagnostic_describe_all_properties,
"The public property isn't described by either 'debugFillProperties' or "
@@ -584,6 +691,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode directives_ordering_alphabetical = LinterLintCode(
LintNames.directives_ordering,
"Sort directive sections alphabetically.",
@@ -591,6 +699,8 @@
uniqueName: 'directives_ordering_alphabetical',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode directives_ordering_dart = LinterLintCode(
LintNames.directives_ordering,
"Place 'dart:' {0} before other {0}.",
@@ -598,6 +708,7 @@
uniqueName: 'directives_ordering_dart',
);
+ /// No parameters.
static const LintCode directives_ordering_exports = LinterLintCode(
LintNames.directives_ordering,
"Specify exports in a separate section after all imports.",
@@ -605,6 +716,8 @@
uniqueName: 'directives_ordering_exports',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode directives_ordering_package_before_relative =
LinterLintCode(
LintNames.directives_ordering,
@@ -613,6 +726,7 @@
uniqueName: 'directives_ordering_package_before_relative',
);
+ /// No parameters.
static const LintCode discarded_futures = LinterLintCode(
LintNames.discarded_futures,
"'Future'-returning calls in a non-'async' function.",
@@ -621,12 +735,14 @@
"the future, or wrap the expression in 'unawaited'.",
);
+ /// No parameters.
static const LintCode do_not_use_environment = LinterLintCode(
LintNames.do_not_use_environment,
"Invalid use of an environment declaration.",
correctionMessage: "Try removing the environment declaration usage.",
);
+ /// No parameters.
static const LintCode document_ignores = LinterLintCode(
LintNames.document_ignores,
"Missing documentation explaining why the diagnostic is ignored.",
@@ -634,6 +750,7 @@
"Try adding a comment immediately above the ignore comment.",
);
+ /// No parameters.
static const LintCode empty_catches = LinterLintCode(
LintNames.empty_catches,
"Empty catch block.",
@@ -643,6 +760,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode empty_constructor_bodies = LinterLintCode(
LintNames.empty_constructor_bodies,
"Empty constructor bodies should be written using a ';' rather than '{}'.",
@@ -650,6 +768,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode empty_statements = LinterLintCode(
LintNames.empty_statements,
"Unnecessary empty statement.",
@@ -658,12 +777,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode eol_at_end_of_file = LinterLintCode(
LintNames.eol_at_end_of_file,
"Missing a newline at the end of the file.",
correctionMessage: "Try adding a newline at the end of the file.",
);
+ /// No parameters.
static const LintCode erase_dart_type_extension_types = LinterLintCode(
LintNames.erase_dart_type_extension_types,
"Unsafe use of 'DartType' in an 'is' check.",
@@ -671,12 +792,16 @@
"Ensure DartType extension types are erased by using a helper method.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode exhaustive_cases = LinterLintCode(
LintNames.exhaustive_cases,
"Missing case clauses for some constants in '{0}'.",
correctionMessage: "Try adding case clauses for the missing constants.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode file_names = LinterLintCode(
LintNames.file_names,
"The file name '{0}' isn't a lower_case_with_underscores identifier.",
@@ -686,12 +811,16 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode flutter_style_todos = LinterLintCode(
LintNames.flutter_style_todos,
"To-do comment doesn't follow the Flutter style.",
correctionMessage: "Try following the Flutter style for to-do comments.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode hash_and_equals = LinterLintCode(
LintNames.hash_and_equals,
"Missing a corresponding override of '{0}'.",
@@ -699,6 +828,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode implementation_imports = LinterLintCode(
LintNames.implementation_imports,
"Import of a library in the 'lib/src' directory of another package.",
@@ -708,6 +838,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode implicit_call_tearoffs = LinterLintCode(
LintNames.implicit_call_tearoffs,
"Implicit tear-off of the 'call' method.",
@@ -715,6 +846,11 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
+ /// 2: undocumented
+ /// 3: undocumented
static const LintCode implicit_reopen = LinterLintCode(
LintNames.implicit_reopen,
"The {0} '{1}' reopens '{2}' because it is not marked '{3}'.",
@@ -722,12 +858,16 @@
"Try marking '{1}' '{3}' or annotating it with '@reopen'.",
);
+ /// No parameters.
static const LintCode invalid_case_patterns = LinterLintCode(
LintNames.invalid_case_patterns,
"This expression is not valid in a 'case' clause in Dart 3.0.",
correctionMessage: "Try refactoring the expression to be valid in 3.0.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_dart_as_js = LinterLintCode(
LintNames.invalid_runtime_check_with_js_interop_types,
@@ -740,6 +880,9 @@
uniqueName: 'invalid_runtime_check_with_js_interop_types_dart_as_js',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_dart_is_js = LinterLintCode(
LintNames.invalid_runtime_check_with_js_interop_types,
@@ -748,6 +891,9 @@
uniqueName: 'invalid_runtime_check_with_js_interop_types_dart_is_js',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_js_as_dart = LinterLintCode(
LintNames.invalid_runtime_check_with_js_interop_types,
@@ -759,6 +905,9 @@
uniqueName: 'invalid_runtime_check_with_js_interop_types_js_as_dart',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_js_as_incompatible_js =
LinterLintCode(
@@ -769,6 +918,9 @@
'invalid_runtime_check_with_js_interop_types_js_as_incompatible_js',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_js_is_dart = LinterLintCode(
LintNames.invalid_runtime_check_with_js_interop_types,
@@ -777,6 +929,9 @@
uniqueName: 'invalid_runtime_check_with_js_interop_types_js_is_dart',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_js_is_inconsistent_js =
LinterLintCode(
@@ -791,6 +946,9 @@
'invalid_runtime_check_with_js_interop_types_js_is_inconsistent_js',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
invalid_runtime_check_with_js_interop_types_js_is_unrelated_js = LinterLintCode(
LintNames.invalid_runtime_check_with_js_interop_types,
@@ -805,6 +963,7 @@
'invalid_runtime_check_with_js_interop_types_js_is_unrelated_js',
);
+ /// No parameters.
static const LintCode join_return_with_assignment = LinterLintCode(
LintNames.join_return_with_assignment,
"Assignment could be inlined in 'return' statement.",
@@ -812,12 +971,14 @@
"Try inlining the assigned value in the 'return' statement.",
);
+ /// No parameters.
static const LintCode leading_newlines_in_multiline_strings = LinterLintCode(
LintNames.leading_newlines_in_multiline_strings,
"Missing a newline at the beginning of a multiline string.",
correctionMessage: "Try adding a newline at the beginning of the string.",
);
+ /// No parameters.
static const LintCode library_annotations = LinterLintCode(
LintNames.library_annotations,
"This annotation should be attached to a library directive.",
@@ -825,6 +986,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode library_names = LinterLintCode(
LintNames.library_names,
"The library name '{0}' isn't a lower_case_with_underscores identifier.",
@@ -834,6 +997,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode library_prefixes = LinterLintCode(
LintNames.library_prefixes,
"The prefix '{0}' isn't a lower_case_with_underscores identifier.",
@@ -843,6 +1008,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode library_private_types_in_public_api = LinterLintCode(
LintNames.library_private_types_in_public_api,
"Invalid use of a private type in a public API.",
@@ -852,12 +1018,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode lines_longer_than_80_chars = LinterLintCode(
LintNames.lines_longer_than_80_chars,
"The line length exceeds the 80-character limit.",
correctionMessage: "Try breaking the line across multiple lines.",
);
+ /// No parameters.
static const LintCode literal_only_boolean_expressions = LinterLintCode(
LintNames.literal_only_boolean_expressions,
"The Boolean expression has a constant value.",
@@ -865,6 +1033,9 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode matching_super_parameters = LinterLintCode(
LintNames.matching_super_parameters,
"The super parameter named '{0}'' does not share the same name as the "
@@ -874,6 +1045,7 @@
"constructor.",
);
+ /// No parameters.
static const LintCode missing_code_block_language_in_doc_comment =
LinterLintCode(
LintNames.missing_code_block_language_in_doc_comment,
@@ -881,6 +1053,7 @@
correctionMessage: "Try adding a language to the code block.",
);
+ /// No parameters.
static const LintCode missing_whitespace_between_adjacent_strings =
LinterLintCode(
LintNames.missing_whitespace_between_adjacent_strings,
@@ -889,6 +1062,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode no_adjacent_strings_in_list = LinterLintCode(
LintNames.no_adjacent_strings_in_list,
"Don't use adjacent strings in a list literal.",
@@ -896,6 +1070,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode no_default_cases = LinterLintCode(
LintNames.no_default_cases,
"Invalid use of 'default' member in a switch.",
@@ -903,6 +1078,9 @@
"Try enumerating all the possible values of the switch expression.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode no_duplicate_case_values = LinterLintCode(
LintNames.no_duplicate_case_values,
"The value of the case clause ('{0}') is equal to the value of an earlier "
@@ -911,6 +1089,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode no_leading_underscores_for_library_prefixes =
LinterLintCode(
LintNames.no_leading_underscores_for_library_prefixes,
@@ -920,6 +1100,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode no_leading_underscores_for_local_identifiers =
LinterLintCode(
LintNames.no_leading_underscores_for_local_identifiers,
@@ -929,6 +1111,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode no_literal_bool_comparisons = LinterLintCode(
LintNames.no_literal_bool_comparisons,
"Unnecessary comparison to a boolean literal.",
@@ -936,6 +1119,7 @@
"Remove the comparison and use the negate `!` operator if necessary.",
);
+ /// No parameters.
static const LintCode no_logic_in_create_state = LinterLintCode(
LintNames.no_logic_in_create_state,
"Don't put any logic in 'createState'.",
@@ -943,6 +1127,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode no_runtimeType_toString = LinterLintCode(
LintNames.no_runtimeType_toString,
"Using 'toString' on a 'Type' is not safe in production code.",
@@ -950,12 +1135,14 @@
"Try removing the usage of 'toString' or restructuring the code.",
);
+ /// No parameters.
static const LintCode no_self_assignments = LinterLintCode(
LintNames.no_self_assignments,
"The variable or property is being assigned to itself.",
correctionMessage: "Try removing the assignment that has no direct effect.",
);
+ /// No parameters.
static const LintCode no_wildcard_variable_uses = LinterLintCode(
LintNames.no_wildcard_variable_uses,
"The referenced identifier is a wildcard.",
@@ -963,6 +1150,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode non_constant_identifier_names = LinterLintCode(
LintNames.non_constant_identifier_names,
"The variable name '{0}' isn't a lowerCamelCase identifier.",
@@ -971,12 +1160,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode noop_primitive_operations = LinterLintCode(
LintNames.noop_primitive_operations,
"The expression has no effect and can be removed.",
correctionMessage: "Try removing the expression.",
);
+ /// No parameters.
static const LintCode null_check_on_nullable_type_parameter = LinterLintCode(
LintNames.null_check_on_nullable_type_parameter,
"The null check operator shouldn't be used on a variable whose type is a "
@@ -985,30 +1176,36 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode null_closures = LinterLintCode(
LintNames.null_closures,
"Closure can't be 'null' because it might be invoked.",
correctionMessage: "Try providing a non-null closure.",
);
+ /// No parameters.
static const LintCode omit_local_variable_types = LinterLintCode(
LintNames.omit_local_variable_types,
"Unnecessary type annotation on a local variable.",
correctionMessage: "Try removing the type annotation.",
);
+ /// No parameters.
static const LintCode omit_obvious_local_variable_types = LinterLintCode(
LintNames.omit_obvious_local_variable_types,
"Omit the type annotation on a local variable when the type is obvious.",
correctionMessage: "Try removing the type annotation.",
);
+ /// No parameters.
static const LintCode omit_obvious_property_types = LinterLintCode(
LintNames.omit_obvious_property_types,
"The type annotation isn't needed because it is obvious.",
correctionMessage: "Try removing the type annotation.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode one_member_abstracts = LinterLintCode(
LintNames.one_member_abstracts,
"Unnecessary use of an abstract class.",
@@ -1016,6 +1213,7 @@
"Try making '{0}' a top-level function and removing the class.",
);
+ /// No parameters.
static const LintCode only_throw_errors = LinterLintCode(
LintNames.only_throw_errors,
"Don't throw instances of classes that don't extend either 'Exception' or "
@@ -1024,6 +1222,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode overridden_fields = LinterLintCode(
LintNames.overridden_fields,
"Field overrides a field inherited from '{0}'.",
@@ -1033,6 +1233,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode package_names = LinterLintCode(
LintNames.package_names,
"The package name '{0}' isn't a lower_case_with_underscores identifier.",
@@ -1042,6 +1244,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode package_prefixed_library_names = LinterLintCode(
LintNames.package_prefixed_library_names,
"The library name is not a dot-separated path prefixed by the package "
@@ -1050,12 +1254,15 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode parameter_assignments = LinterLintCode(
LintNames.parameter_assignments,
"Invalid assignment to the parameter '{0}'.",
correctionMessage: "Try using a local variable in place of the parameter.",
);
+ /// No parameters.
static const LintCode prefer_adjacent_string_concatenation = LinterLintCode(
LintNames.prefer_adjacent_string_concatenation,
"String literals shouldn't be concatenated by the '+' operator.",
@@ -1063,6 +1270,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_asserts_in_initializer_lists = LinterLintCode(
LintNames.prefer_asserts_in_initializer_lists,
"Assert should be in the initializer list.",
@@ -1070,6 +1278,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_asserts_with_message = LinterLintCode(
LintNames.prefer_asserts_with_message,
"Missing a message in an assert.",
@@ -1077,6 +1286,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_collection_literals = LinterLintCode(
LintNames.prefer_collection_literals,
"Unnecessary constructor invocation.",
@@ -1084,6 +1294,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_conditional_assignment = LinterLintCode(
LintNames.prefer_conditional_assignment,
"The 'if' statement could be replaced by a null-aware assignment.",
@@ -1092,6 +1303,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_const_constructors = LinterLintCode(
LintNames.prefer_const_constructors,
"Use 'const' with the constructor to improve performance.",
@@ -1100,6 +1312,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_const_constructors_in_immutables =
LinterLintCode(
LintNames.prefer_const_constructors_in_immutables,
@@ -1108,6 +1321,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_const_declarations = LinterLintCode(
LintNames.prefer_const_declarations,
"Use 'const' for final variables initialized to a constant value.",
@@ -1115,6 +1329,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_const_literals_to_create_immutables =
LinterLintCode(
LintNames.prefer_const_literals_to_create_immutables,
@@ -1124,6 +1339,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_constructors_over_static_methods =
LinterLintCode(
LintNames.prefer_constructors_over_static_methods,
@@ -1132,18 +1348,21 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_contains_always_false = LinterLintCode(
LintNames.prefer_contains,
"Always 'false' because 'indexOf' is always greater than or equal to -1.",
uniqueName: 'prefer_contains_always_false',
);
+ /// No parameters.
static const LintCode prefer_contains_always_true = LinterLintCode(
LintNames.prefer_contains,
"Always 'true' because 'indexOf' is always greater than or equal to -1.",
uniqueName: 'prefer_contains_always_true',
);
+ /// No parameters.
static const LintCode prefer_contains_use_contains = LinterLintCode(
LintNames.prefer_contains,
"Unnecessary use of 'indexOf' to test for containment.",
@@ -1152,6 +1371,7 @@
uniqueName: 'prefer_contains_use_contains',
);
+ /// No parameters.
static const LintCode prefer_double_quotes = LinterLintCode(
LintNames.prefer_double_quotes,
"Unnecessary use of single quotes.",
@@ -1160,6 +1380,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_expression_function_bodies = LinterLintCode(
LintNames.prefer_expression_function_bodies,
"Unnecessary use of a block function body.",
@@ -1167,6 +1388,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_final_fields = LinterLintCode(
LintNames.prefer_final_fields,
"The private field {0} could be 'final'.",
@@ -1174,6 +1397,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_final_in_for_each_pattern = LinterLintCode(
LintNames.prefer_final_in_for_each,
"The pattern should be final.",
@@ -1182,6 +1406,8 @@
uniqueName: 'prefer_final_in_for_each_pattern',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_final_in_for_each_variable = LinterLintCode(
LintNames.prefer_final_in_for_each,
"The variable '{0}' should be final.",
@@ -1189,6 +1415,7 @@
uniqueName: 'prefer_final_in_for_each_variable',
);
+ /// No parameters.
static const LintCode prefer_final_locals = LinterLintCode(
LintNames.prefer_final_locals,
"Local variables should be final.",
@@ -1196,6 +1423,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_final_parameters = LinterLintCode(
LintNames.prefer_final_parameters,
"The parameter '{0}' should be final.",
@@ -1203,6 +1432,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_for_elements_to_map_fromIterable =
LinterLintCode(
LintNames.prefer_for_elements_to_map_fromIterable,
@@ -1212,6 +1442,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_foreach = LinterLintCode(
LintNames.prefer_foreach,
"Use 'forEach' and a tear-off rather than a 'for' loop to apply a function "
@@ -1221,6 +1452,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode
prefer_function_declarations_over_variables = LinterLintCode(
LintNames.prefer_function_declarations_over_variables,
@@ -1231,6 +1463,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_generic_function_type_aliases = LinterLintCode(
LintNames.prefer_generic_function_type_aliases,
"Use the generic function type syntax in 'typedef's.",
@@ -1238,6 +1472,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_if_elements_to_conditional_expressions =
LinterLintCode(
LintNames.prefer_if_elements_to_conditional_expressions,
@@ -1246,6 +1481,7 @@
"Try using an 'if' element rather than a conditional expression.",
);
+ /// No parameters.
static const LintCode prefer_if_null_operators = LinterLintCode(
LintNames.prefer_if_null_operators,
"Use the '??' operator rather than '?:' when testing for 'null'.",
@@ -1253,6 +1489,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_initializing_formals = LinterLintCode(
LintNames.prefer_initializing_formals,
"Use an initializing formal to assign a parameter to a field.",
@@ -1261,6 +1499,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_inlined_adds_multiple = LinterLintCode(
LintNames.prefer_inlined_adds,
"The addition of multiple list items could be inlined.",
@@ -1269,6 +1508,7 @@
uniqueName: 'prefer_inlined_adds_multiple',
);
+ /// No parameters.
static const LintCode prefer_inlined_adds_single = LinterLintCode(
LintNames.prefer_inlined_adds,
"The addition of a list item could be inlined.",
@@ -1277,12 +1517,14 @@
uniqueName: 'prefer_inlined_adds_single',
);
+ /// No parameters.
static const LintCode prefer_int_literals = LinterLintCode(
LintNames.prefer_int_literals,
"Unnecessary use of a 'double' literal.",
correctionMessage: "Try using an 'int' literal.",
);
+ /// No parameters.
static const LintCode prefer_interpolation_to_compose_strings =
LinterLintCode(
LintNames.prefer_interpolation_to_compose_strings,
@@ -1292,6 +1534,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_is_empty_always_false = LinterLintCode(
LintNames.prefer_is_empty,
"The comparison is always 'false' because the length is always greater "
@@ -1299,6 +1542,7 @@
uniqueName: 'prefer_is_empty_always_false',
);
+ /// No parameters.
static const LintCode prefer_is_empty_always_true = LinterLintCode(
LintNames.prefer_is_empty,
"The comparison is always 'true' because the length is always greater than "
@@ -1306,6 +1550,7 @@
uniqueName: 'prefer_is_empty_always_true',
);
+ /// No parameters.
static const LintCode prefer_is_empty_use_is_empty = LinterLintCode(
LintNames.prefer_is_empty,
"Use 'isEmpty' instead of 'length' to test whether the collection is "
@@ -1315,6 +1560,7 @@
uniqueName: 'prefer_is_empty_use_is_empty',
);
+ /// No parameters.
static const LintCode prefer_is_empty_use_is_not_empty = LinterLintCode(
LintNames.prefer_is_empty,
"Use 'isNotEmpty' instead of 'length' to test whether the collection is "
@@ -1324,6 +1570,7 @@
uniqueName: 'prefer_is_empty_use_is_not_empty',
);
+ /// No parameters.
static const LintCode prefer_is_not_empty = LinterLintCode(
LintNames.prefer_is_not_empty,
"Use 'isNotEmpty' rather than negating the result of 'isEmpty'.",
@@ -1331,6 +1578,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_is_not_operator = LinterLintCode(
LintNames.prefer_is_not_operator,
"Use the 'is!' operator rather than negating the value of the 'is' "
@@ -1339,6 +1587,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_iterable_whereType = LinterLintCode(
LintNames.prefer_iterable_whereType,
"Use 'whereType' to select elements of a given type.",
@@ -1346,12 +1595,15 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode prefer_mixin = LinterLintCode(
LintNames.prefer_mixin,
"Only mixins should be mixed in.",
correctionMessage: "Try converting '{0}' to a mixin.",
);
+ /// No parameters.
static const LintCode prefer_null_aware_method_calls = LinterLintCode(
LintNames.prefer_null_aware_method_calls,
"Use a null-aware invocation of the 'call' method rather than explicitly "
@@ -1359,6 +1611,7 @@
correctionMessage: "Try using '?.call()' to invoke the function.",
);
+ /// No parameters.
static const LintCode prefer_null_aware_operators = LinterLintCode(
LintNames.prefer_null_aware_operators,
"Use the null-aware operator '?.' rather than an explicit 'null' "
@@ -1367,6 +1620,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_relative_imports = LinterLintCode(
LintNames.prefer_relative_imports,
"Use relative imports for files in the 'lib' directory.",
@@ -1374,6 +1628,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_single_quotes = LinterLintCode(
LintNames.prefer_single_quotes,
"Unnecessary use of double quotes.",
@@ -1382,6 +1637,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode prefer_spread_collections = LinterLintCode(
LintNames.prefer_spread_collections,
"The addition of multiple elements could be inlined.",
@@ -1389,6 +1645,7 @@
"Try using the spread operator ('...') to inline the addition.",
);
+ /// No parameters.
static const LintCode prefer_typing_uninitialized_variables_for_field =
LinterLintCode(
LintNames.prefer_typing_uninitialized_variables,
@@ -1398,6 +1655,7 @@
uniqueName: 'prefer_typing_uninitialized_variables_for_field',
);
+ /// No parameters.
static const LintCode
prefer_typing_uninitialized_variables_for_local_variable = LinterLintCode(
LintNames.prefer_typing_uninitialized_variables,
@@ -1407,6 +1665,7 @@
uniqueName: 'prefer_typing_uninitialized_variables_for_local_variable',
);
+ /// No parameters.
static const LintCode prefer_void_to_null = LinterLintCode(
LintNames.prefer_void_to_null,
"Unnecessary use of the type 'Null'.",
@@ -1414,6 +1673,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode provide_deprecation_message = LinterLintCode(
LintNames.provide_deprecation_message,
"Missing a deprecation message.",
@@ -1423,6 +1683,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode public_member_api_docs = LinterLintCode(
LintNames.public_member_api_docs,
"Missing documentation for a public member.",
@@ -1430,6 +1691,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode recursive_getters = LinterLintCode(
LintNames.recursive_getters,
"The getter '{0}' recursively returns itself.",
@@ -1437,12 +1700,15 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode require_trailing_commas = LinterLintCode(
LintNames.require_trailing_commas,
"Missing a required trailing comma.",
correctionMessage: "Try adding a trailing comma.",
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode secure_pubspec_urls = LinterLintCode(
LintNames.secure_pubspec_urls,
"The '{0}' protocol shouldn't be used because it isn't secure.",
@@ -1450,6 +1716,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode sized_box_for_whitespace = LinterLintCode(
LintNames.sized_box_for_whitespace,
"Use a 'SizedBox' to add whitespace to a layout.",
@@ -1457,6 +1724,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode sized_box_shrink_expand = LinterLintCode(
LintNames.sized_box_shrink_expand,
"Use 'SizedBox.{0}' to avoid needing to specify the 'height' and 'width'.",
@@ -1466,6 +1735,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode slash_for_doc_comments = LinterLintCode(
LintNames.slash_for_doc_comments,
"Use the end-of-line form ('///') for doc comments.",
@@ -1473,6 +1743,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode sort_child_properties_last = LinterLintCode(
LintNames.sort_child_properties_last,
"The '{0}' argument should be last in widget constructor invocations.",
@@ -1481,6 +1753,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode sort_constructors_first = LinterLintCode(
LintNames.sort_constructors_first,
"Constructor declarations should be before non-constructor declarations.",
@@ -1489,6 +1762,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode sort_pub_dependencies = LinterLintCode(
LintNames.sort_pub_dependencies,
"Dependencies not sorted alphabetically.",
@@ -1496,6 +1770,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode sort_unnamed_constructors_first = LinterLintCode(
LintNames.sort_unnamed_constructors_first,
"Invalid location for the unnamed constructor.",
@@ -1504,6 +1779,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode specify_nonobvious_local_variable_types =
LinterLintCode(
LintNames.specify_nonobvious_local_variable_types,
@@ -1511,12 +1787,14 @@
correctionMessage: "Try adding a type annotation.",
);
+ /// No parameters.
static const LintCode specify_nonobvious_property_types = LinterLintCode(
LintNames.specify_nonobvious_property_types,
"A type annotation is needed because it isn't obvious.",
correctionMessage: "Try adding a type annotation.",
);
+ /// No parameters.
static const LintCode strict_top_level_inference_add_type = LinterLintCode(
LintNames.strict_top_level_inference,
"Missing type annotation.",
@@ -1524,6 +1802,8 @@
uniqueName: 'strict_top_level_inference_add_type',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode strict_top_level_inference_replace_keyword =
LinterLintCode(
LintNames.strict_top_level_inference,
@@ -1532,6 +1812,7 @@
uniqueName: 'strict_top_level_inference_replace_keyword',
);
+ /// No parameters.
static const LintCode strict_top_level_inference_split_to_types =
LinterLintCode(
LintNames.strict_top_level_inference,
@@ -1542,6 +1823,7 @@
uniqueName: 'strict_top_level_inference_split_to_types',
);
+ /// No parameters.
static const LintCode switch_on_type = LinterLintCode(
LintNames.switch_on_type,
"Avoid switch statements on a 'Type'.",
@@ -1549,6 +1831,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode test_types_in_equals = LinterLintCode(
LintNames.test_types_in_equals,
"Missing type test for '{0}' in '=='.",
@@ -1556,6 +1840,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode throw_in_finally = LinterLintCode(
LintNames.throw_in_finally,
"Use of '{0}' in 'finally' block.",
@@ -1563,6 +1849,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode tighten_type_of_initializing_formals = LinterLintCode(
LintNames.tighten_type_of_initializing_formals,
"Use a type annotation rather than 'assert' to enforce non-nullability.",
@@ -1571,6 +1858,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode type_annotate_public_apis = LinterLintCode(
LintNames.type_annotate_public_apis,
"Missing type annotation on a public API.",
@@ -1578,6 +1866,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode type_init_formals = LinterLintCode(
LintNames.type_init_formals,
"Don't needlessly type annotate initializing formals.",
@@ -1585,6 +1874,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode type_literal_in_constant_pattern = LinterLintCode(
LintNames.type_literal_in_constant_pattern,
"Use 'TypeName _' instead of a type literal.",
@@ -1592,6 +1882,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unawaited_futures = LinterLintCode(
LintNames.unawaited_futures,
"Missing an 'await' for the 'Future' computed by this expression.",
@@ -1600,6 +1891,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unintended_html_in_doc_comment = LinterLintCode(
LintNames.unintended_html_in_doc_comment,
"Angle brackets will be interpreted as HTML.",
@@ -1609,18 +1901,21 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_async = LinterLintCode(
LintNames.unnecessary_async,
"Don't make a function 'async' if it doesn't use 'await'.",
correctionMessage: "Try removing the 'async' modifier.",
);
+ /// No parameters.
static const LintCode unnecessary_await_in_return = LinterLintCode(
LintNames.unnecessary_await_in_return,
"Unnecessary 'await'.",
correctionMessage: "Try removing the 'await'.",
);
+ /// No parameters.
static const LintCode unnecessary_brace_in_string_interps = LinterLintCode(
LintNames.unnecessary_brace_in_string_interps,
"Unnecessary braces in a string interpolation.",
@@ -1628,12 +1923,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_breaks = LinterLintCode(
LintNames.unnecessary_breaks,
"Unnecessary 'break' statement.",
correctionMessage: "Try removing the 'break'.",
);
+ /// No parameters.
static const LintCode unnecessary_const = LinterLintCode(
LintNames.unnecessary_const,
"Unnecessary 'const' keyword.",
@@ -1641,6 +1938,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_constructor_name = LinterLintCode(
LintNames.unnecessary_constructor_name,
"Unnecessary '.new' constructor name.",
@@ -1648,6 +1946,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_final_with_type = LinterLintCode(
LintNames.unnecessary_final,
"Local variables should not be marked as 'final'.",
@@ -1656,6 +1955,7 @@
uniqueName: 'unnecessary_final_with_type',
);
+ /// No parameters.
static const LintCode unnecessary_final_without_type = LinterLintCode(
LintNames.unnecessary_final,
"Local variables should not be marked as 'final'.",
@@ -1663,6 +1963,7 @@
uniqueName: 'unnecessary_final_without_type',
);
+ /// No parameters.
static const LintCode unnecessary_getters_setters = LinterLintCode(
LintNames.unnecessary_getters_setters,
"Unnecessary use of getter and setter to wrap a field.",
@@ -1671,6 +1972,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode unnecessary_ignore = LinterLintCode(
LintNames.unnecessary_ignore,
"The diagnostic '{0}' isn't produced at this location so it doesn't need "
@@ -1680,6 +1983,8 @@
uniqueName: 'unnecessary_ignore',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode unnecessary_ignore_file = LinterLintCode(
LintNames.unnecessary_ignore,
"The diagnostic '{0}' isn't produced in this file so it doesn't need to be "
@@ -1688,6 +1993,8 @@
uniqueName: 'unnecessary_ignore_file',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode unnecessary_ignore_name = LinterLintCode(
LintNames.unnecessary_ignore,
"The diagnostic '{0}' isn't produced at this location so it doesn't need "
@@ -1696,6 +2003,8 @@
uniqueName: 'unnecessary_ignore_name',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode unnecessary_ignore_name_file = LinterLintCode(
LintNames.unnecessary_ignore,
"The diagnostic '{0}' isn't produced in this file so it doesn't need to be "
@@ -1704,6 +2013,7 @@
uniqueName: 'unnecessary_ignore_name_file',
);
+ /// No parameters.
static const LintCode unnecessary_lambdas = LinterLintCode(
LintNames.unnecessary_lambdas,
"Closure should be a tearoff.",
@@ -1711,6 +2021,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_late = LinterLintCode(
LintNames.unnecessary_late,
"Unnecessary 'late' modifier.",
@@ -1718,12 +2029,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_library_directive = LinterLintCode(
LintNames.unnecessary_library_directive,
"Library directives without comments or annotations should be avoided.",
correctionMessage: "Try deleting the library directive.",
);
+ /// No parameters.
static const LintCode unnecessary_library_name = LinterLintCode(
LintNames.unnecessary_library_name,
"Library names are not necessary.",
@@ -1731,6 +2044,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_new = LinterLintCode(
LintNames.unnecessary_new,
"Unnecessary 'new' keyword.",
@@ -1738,6 +2052,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_null_aware_assignments = LinterLintCode(
LintNames.unnecessary_null_aware_assignments,
"Unnecessary assignment of 'null'.",
@@ -1745,6 +2060,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode
unnecessary_null_aware_operator_on_extension_on_nullable = LinterLintCode(
LintNames.unnecessary_null_aware_operator_on_extension_on_nullable,
@@ -1754,6 +2070,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_null_checks = LinterLintCode(
LintNames.unnecessary_null_checks,
"Unnecessary use of a null check ('!').",
@@ -1761,6 +2078,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_null_in_if_null_operators = LinterLintCode(
LintNames.unnecessary_null_in_if_null_operators,
"Unnecessary use of '??' with 'null'.",
@@ -1768,6 +2086,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_nullable_for_final_variable_declarations =
LinterLintCode(
LintNames.unnecessary_nullable_for_final_variable_declarations,
@@ -1776,6 +2095,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_overrides = LinterLintCode(
LintNames.unnecessary_overrides,
"Unnecessary override.",
@@ -1785,6 +2105,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_parenthesis = LinterLintCode(
LintNames.unnecessary_parenthesis,
"Unnecessary use of parentheses.",
@@ -1792,6 +2113,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_raw_strings = LinterLintCode(
LintNames.unnecessary_raw_strings,
"Unnecessary use of a raw string.",
@@ -1799,6 +2121,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_statements = LinterLintCode(
LintNames.unnecessary_statements,
"Unnecessary statement.",
@@ -1806,6 +2129,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_string_escapes = LinterLintCode(
LintNames.unnecessary_string_escapes,
"Unnecessary escape in string literal.",
@@ -1813,6 +2137,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_string_interpolations = LinterLintCode(
LintNames.unnecessary_string_interpolations,
"Unnecessary use of string interpolation.",
@@ -1821,6 +2146,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_this = LinterLintCode(
LintNames.unnecessary_this,
"Unnecessary 'this.' qualifier.",
@@ -1828,6 +2154,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_to_list_in_spreads = LinterLintCode(
LintNames.unnecessary_to_list_in_spreads,
"Unnecessary use of 'toList' in a spread.",
@@ -1835,6 +2162,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_unawaited = LinterLintCode(
LintNames.unnecessary_unawaited,
"Unnecessary use of 'unawaited'.",
@@ -1844,6 +2172,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode unnecessary_underscores = LinterLintCode(
LintNames.unnecessary_underscores,
"Unnecessary use of multiple underscores.",
@@ -1851,12 +2180,17 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode unreachable_from_main = LinterLintCode(
LintNames.unreachable_from_main,
"Unreachable member '{0}' in an executable library.",
correctionMessage: "Try referencing the member or removing it.",
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode
unrelated_type_equality_checks_in_expression = LinterLintCode(
LintNames.unrelated_type_equality_checks,
@@ -1867,6 +2201,9 @@
uniqueName: 'unrelated_type_equality_checks_in_expression',
);
+ /// Parameters:
+ /// 0: undocumented
+ /// 1: undocumented
static const LintCode unrelated_type_equality_checks_in_pattern =
LinterLintCode(
LintNames.unrelated_type_equality_checks,
@@ -1877,6 +2214,7 @@
uniqueName: 'unrelated_type_equality_checks_in_pattern',
);
+ /// No parameters.
static const LintCode unsafe_variance = LinterLintCode(
LintNames.unsafe_variance,
"This type is unsafe: a type parameter occurs in a non-covariant position.",
@@ -1886,6 +2224,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode
use_build_context_synchronously_async_use = LinterLintCode(
LintNames.use_build_context_synchronously,
@@ -1897,6 +2236,7 @@
uniqueName: 'use_build_context_synchronously_async_use',
);
+ /// No parameters.
static const LintCode
use_build_context_synchronously_wrong_mounted = LinterLintCode(
LintNames.use_build_context_synchronously,
@@ -1909,6 +2249,7 @@
uniqueName: 'use_build_context_synchronously_wrong_mounted',
);
+ /// No parameters.
static const LintCode use_colored_box = LinterLintCode(
LintNames.use_colored_box,
"Use a 'ColoredBox' rather than a 'Container' with only a 'Color'.",
@@ -1916,6 +2257,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_decorated_box = LinterLintCode(
LintNames.use_decorated_box,
"Use 'DecoratedBox' rather than a 'Container' with only a 'Decoration'.",
@@ -1923,12 +2265,14 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_enums = LinterLintCode(
LintNames.use_enums,
"Class should be an enum.",
correctionMessage: "Try using an enum rather than a class.",
);
+ /// No parameters.
static const LintCode use_full_hex_values_for_flutter_colors = LinterLintCode(
LintNames.use_full_hex_values_for_flutter_colors,
"Instances of 'Color' should be created using an 8-digit hexadecimal "
@@ -1936,6 +2280,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode use_function_type_syntax_for_parameters =
LinterLintCode(
LintNames.use_function_type_syntax_for_parameters,
@@ -1944,6 +2290,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_if_null_to_convert_nulls_to_bools = LinterLintCode(
LintNames.use_if_null_to_convert_nulls_to_bools,
"Use an if-null operator to convert a 'null' to a 'bool'.",
@@ -1951,12 +2298,15 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode use_is_even_rather_than_modulo = LinterLintCode(
LintNames.use_is_even_rather_than_modulo,
"Use '{0}' rather than '% 2'.",
correctionMessage: "Try using '{0}'.",
);
+ /// No parameters.
static const LintCode use_key_in_widget_constructors = LinterLintCode(
LintNames.use_key_in_widget_constructors,
"Constructors for public widgets should have a named 'key' parameter.",
@@ -1964,6 +2314,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_late_for_private_fields_and_variables =
LinterLintCode(
LintNames.use_late_for_private_fields_and_variables,
@@ -1972,6 +2323,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode use_named_constants = LinterLintCode(
LintNames.use_named_constants,
"Use the constant '{0}' rather than a constructor returning the same "
@@ -1980,6 +2333,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_null_aware_elements = LinterLintCode(
LintNames.use_null_aware_elements,
"Use the null-aware marker '?' rather than a null check via an 'if'.",
@@ -1987,6 +2341,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_raw_strings = LinterLintCode(
LintNames.use_raw_strings,
"Use a raw string to avoid using escapes.",
@@ -1995,6 +2350,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_rethrow_when_possible = LinterLintCode(
LintNames.use_rethrow_when_possible,
"Use 'rethrow' to rethrow a caught exception.",
@@ -2002,6 +2358,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_setters_to_change_properties = LinterLintCode(
LintNames.use_setters_to_change_properties,
"The method is used to change a property.",
@@ -2009,6 +2366,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_string_buffers = LinterLintCode(
LintNames.use_string_buffers,
"Use a string buffer rather than '+' to compose strings.",
@@ -2016,6 +2374,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode use_string_in_part_of_directives = LinterLintCode(
LintNames.use_string_in_part_of_directives,
"The part-of directive uses a library name.",
@@ -2024,6 +2383,8 @@
hasPublishedDocs: true,
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode use_super_parameters_multiple = LinterLintCode(
LintNames.use_super_parameters,
"Parameters '{0}' could be super parameters.",
@@ -2032,6 +2393,8 @@
uniqueName: 'use_super_parameters_multiple',
);
+ /// Parameters:
+ /// 0: undocumented
static const LintCode use_super_parameters_single = LinterLintCode(
LintNames.use_super_parameters,
"Parameter '{0}' could be a super parameter.",
@@ -2040,6 +2403,7 @@
uniqueName: 'use_super_parameters_single',
);
+ /// No parameters.
static const LintCode use_test_throws_matchers = LinterLintCode(
LintNames.use_test_throws_matchers,
"Use the 'throwsA' matcher instead of using 'fail' when there is no "
@@ -2049,12 +2413,14 @@
"exception.",
);
+ /// No parameters.
static const LintCode use_to_and_as_if_applicable = LinterLintCode(
LintNames.use_to_and_as_if_applicable,
"Start the name of the method with 'to' or 'as'.",
correctionMessage: "Try renaming the method to use either 'to' or 'as'.",
);
+ /// No parameters.
static const LintCode use_truncating_division = LinterLintCode(
LintNames.use_truncating_division,
"Use truncating division.",
@@ -2064,6 +2430,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode valid_regexps = LinterLintCode(
LintNames.valid_regexps,
"Invalid regular expression syntax.",
@@ -2071,6 +2438,7 @@
hasPublishedDocs: true,
);
+ /// No parameters.
static const LintCode void_checks = LinterLintCode(
LintNames.void_checks,
"Assignment to a variable of type 'void'.",
diff --git a/pkg/linter/messages.yaml b/pkg/linter/messages.yaml
index 3a99308..97efe3a 100644
--- a/pkg/linter/messages.yaml
+++ b/pkg/linter/messages.yaml
@@ -29,6 +29,9 @@
LintCode:
always_declare_return_types_of_functions:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: always_declare_return_types
problemMessage: "The function '{0}' should have a return type but doesn't."
correctionMessage: "Try adding a return type to the function."
@@ -90,11 +93,15 @@
typedef predicate = bool Function(Object o);
```
always_declare_return_types_of_methods:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: always_declare_return_types
problemMessage: "The method '{0}' should have a return type but doesn't."
correctionMessage: "Try adding a return type to the method."
hasPublishedDocs: true
always_put_control_body_on_new_line:
+ comment: No parameters.
problemMessage: "Statement should be on a separate line."
correctionMessage: "Try moving the statement to a new line."
state:
@@ -168,6 +175,7 @@
[Dart formatter](https://dart.dev/tools/dart-format), and should not be enabled
when the Dart formatter is used.
always_put_required_named_parameters_first:
+ comment: No parameters.
problemMessage: "Required named parameters should be before optional named parameters."
correctionMessage: "Try moving the required named parameter to be before any optional named parameters."
state:
@@ -220,6 +228,7 @@
m({@required a, b, c}) ;
```
always_require_non_null_named_parameters:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.3"
@@ -250,6 +259,7 @@
NOTE: Only asserts at the start of the bodies will be taken into account.
always_specify_types_add_type:
+ comment: No parameters.
sharedName: always_specify_types
problemMessage: "Missing type annotation."
correctionMessage: "Try adding a type annotation."
@@ -301,21 +311,30 @@
}
```
always_specify_types_replace_keyword:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: always_specify_types
problemMessage: "Missing type annotation."
correctionMessage: "Try replacing '{0}' with '{1}'."
hasPublishedDocs: false
always_specify_types_specify_type:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: always_specify_types
problemMessage: "Missing type annotation."
correctionMessage: "Try specifying the type '{0}'."
hasPublishedDocs: false
always_specify_types_split_to_types:
+ comment: No parameters.
sharedName: always_specify_types
problemMessage: "Missing type annotation."
correctionMessage: "Try splitting the declaration and specify the different type annotations."
hasPublishedDocs: false
always_use_package_imports:
+ comment: No parameters.
problemMessage: "Use 'package:' imports for files in the 'lib' directory."
correctionMessage: "Try converting the URI to a 'package:' URI."
state:
@@ -380,6 +399,9 @@
...
```
annotate_overrides:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The member '{0}' overrides an inherited member but isn't annotated with '@override'."
correctionMessage: "Try adding the '@override' annotation."
state:
@@ -468,6 +490,9 @@
}
```
annotate_redeclares:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The member '{0}' is redeclaring but isn't annotated with '@redeclare'."
correctionMessage: "Try adding the '@redeclare' annotation."
state:
@@ -510,6 +535,7 @@
}
```
avoid_annotating_with_dynamic:
+ comment: No parameters.
problemMessage: "Unnecessary 'dynamic' type annotation."
correctionMessage: "Try removing the type 'dynamic'."
state:
@@ -540,6 +566,7 @@
}
```
avoid_as:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.0"
@@ -583,6 +610,7 @@
HasScrollDirection scrollable = renderObject as dynamic;
```
avoid_bool_literals_in_conditional_expressions:
+ comment: No parameters.
problemMessage: "Conditional expressions with a 'bool' literal can be simplified."
correctionMessage: "Try rewriting the expression to use either '&&' or '||'."
state:
@@ -608,6 +636,7 @@
condition && boolExpression
```
avoid_catches_without_on_clauses:
+ comment: No parameters.
problemMessage: "Catch clause should use 'on' to specify the type of exception being caught."
correctionMessage: "Try adding an 'on' clause before the 'catch'."
state:
@@ -653,6 +682,7 @@
referenced _before_ the relevant code, for example to instantiate a wrapper
exception, the variable is not "directly used."
avoid_catching_errors_class:
+ comment: No parameters.
sharedName: avoid_catching_errors
problemMessage: "The type 'Error' should not be caught."
correctionMessage: "Try removing the catch or catching an 'Exception' instead."
@@ -684,11 +714,15 @@
}
```
avoid_catching_errors_subclass:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: avoid_catching_errors
problemMessage: "The type '{0}' should not be caught because it is a subclass of 'Error'."
correctionMessage: "Try removing the catch or catching an 'Exception' instead."
hasPublishedDocs: false
avoid_classes_with_only_static_members:
+ comment: No parameters.
problemMessage: "Classes should define instance members."
correctionMessage: "Try adding instance behavior or moving the members out of the class."
state:
@@ -726,6 +760,7 @@
const _favoriteMammal = 'weasel';
```
avoid_double_and_int_checks:
+ comment: No parameters.
problemMessage: "Explicit check for double or int."
correctionMessage: "Try removing the check."
state:
@@ -761,6 +796,7 @@
}
```
avoid_dynamic_calls:
+ comment: No parameters.
problemMessage: "Method invocation or property access on a 'dynamic' target."
correctionMessage: "Try giving the target a type."
state:
@@ -874,6 +910,7 @@
}
```
avoid_empty_else:
+ comment: No parameters.
problemMessage: "Empty statements are not allowed in an 'else' clause."
correctionMessage: "Try removing the empty statement or removing the else clause."
state:
@@ -969,6 +1006,9 @@
print('2');
```
avoid_equals_and_hash_code_on_mutable_classes:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The method '{0}' should not be overridden in classes not annotated with '@immutable'."
correctionMessage: "Try removing the override or annotating the class with '@immutable'."
state:
@@ -1023,6 +1063,10 @@
}
```
avoid_escaping_inner_quotes:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "Unnecessary escape of '{0}'."
correctionMessage: "Try changing the outer quotes to '{1}'."
state:
@@ -1042,6 +1086,7 @@
var s = "It's not fun";
```
avoid_field_initializers_in_const_classes:
+ comment: No parameters.
problemMessage: "Fields in 'const' classes should not have initializers."
correctionMessage: "Try converting the field to a getter or initialize the field in the constructors."
state:
@@ -1073,6 +1118,7 @@
}
```
avoid_final_parameters:
+ comment: No parameters.
problemMessage: "Parameters should not be marked as 'final'."
correctionMessage: "Try removing the keyword 'final'."
state:
@@ -1119,6 +1165,7 @@
[1, 4, 6, 8].forEach((value) => print(value + 2)); // OK
```
avoid_function_literals_in_foreach_calls:
+ comment: No parameters.
problemMessage: "Function literals shouldn't be passed to 'forEach'."
correctionMessage: "Try using a 'for' loop."
state:
@@ -1185,6 +1232,7 @@
}
```
avoid_futureor_void:
+ comment: No parameters.
problemMessage: "Don't use the type 'FutureOr<void>'."
correctionMessage: "Try using 'Future<void>?' or 'void'."
state:
@@ -1280,6 +1328,7 @@
or removed. Feedback on its behavior is welcome! The main issue is here:
https://github.com/dart-lang/sdk/issues/59232.
avoid_implementing_value_types:
+ comment: No parameters.
problemMessage: "Classes that override '==' should not be implemented."
correctionMessage: "Try removing the class from the 'implements' clause."
state:
@@ -1361,6 +1410,7 @@
}
```
avoid_init_to_null:
+ comment: No parameters.
problemMessage: "Redundant initialization to 'null'."
correctionMessage: "Try removing the initializer."
state:
@@ -1454,6 +1504,7 @@
}
```
avoid_js_rounded_ints:
+ comment: No parameters.
problemMessage: "Integer literal can't be represented exactly when compiled to JavaScript."
correctionMessage: "Try using a 'BigInt' to represent the value."
state:
@@ -1481,6 +1532,7 @@
BigInt value = BigInt.parse('9007199254740995');
```
avoid_multiple_declarations_per_line:
+ comment: No parameters.
problemMessage: "Multiple variables declared on a single line."
correctionMessage: "Try splitting the variable declarations into multiple lines."
state:
@@ -1502,6 +1554,7 @@
String? baz;
```
avoid_null_checks_in_equality_operators:
+ comment: No parameters.
problemMessage: "Unnecessary null comparison in implementation of '=='."
correctionMessage: "Try removing the comparison."
state:
@@ -1540,6 +1593,7 @@
}
```
avoid_positional_boolean_parameters:
+ comment: No parameters.
problemMessage: "'bool' parameters should be named parameters."
correctionMessage: "Try converting the parameter to a named parameter."
state:
@@ -1572,6 +1626,7 @@
Button(ButtonState.enabled);
```
avoid_print:
+ comment: No parameters.
problemMessage: "Don't invoke 'print' in production code."
correctionMessage: "Try using a logging framework."
state:
@@ -1658,6 +1713,7 @@
}
```
avoid_private_typedef_functions:
+ comment: No parameters.
problemMessage: "The typedef is unnecessary because it is only used in one place."
correctionMessage: "Try inlining the type or using it in other places."
state:
@@ -1679,6 +1735,7 @@
m(void Function() f);
```
avoid_redundant_argument_values:
+ comment: No parameters.
problemMessage: "The value of the argument is redundant because it matches the default value."
correctionMessage: "Try removing the argument."
state:
@@ -1725,6 +1782,7 @@
}
```
avoid_relative_lib_imports:
+ comment: No parameters.
problemMessage: "Can't use a relative path to import a library in 'lib'."
correctionMessage: "Try fixing the relative path or changing the import to a 'package:' import."
state:
@@ -1789,6 +1847,10 @@
...
```
avoid_renaming_method_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "The parameter name '{0}' doesn't match the name '{1}' in the overridden method."
correctionMessage: "Try changing the name to '{1}'."
state:
@@ -1862,6 +1924,7 @@
}
```
avoid_return_types_on_setters:
+ comment: No parameters.
problemMessage: "Unnecessary return type on a setter."
correctionMessage: "Try removing the return type."
state:
@@ -1908,6 +1971,7 @@
set speed(int ms);
```
avoid_returning_null:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.3"
@@ -1938,6 +2002,7 @@
double getDouble() => -1.0;
```
avoid_returning_null_for_future:
+ comment: No parameters.
state:
stable: "2.1"
removed: "3.3"
@@ -1950,6 +2015,7 @@
It is almost always wrong to return `null` for a `Future`. Most of the time the
developer simply forgot to put an `async` keyword on the function.
avoid_returning_null_for_void_from_function:
+ comment: No parameters.
sharedName: avoid_returning_null_for_void
problemMessage: "Don't return 'null' from a function with a return type of 'void'."
correctionMessage: "Try removing the 'null'."
@@ -2012,11 +2078,13 @@
}
```
avoid_returning_null_for_void_from_method:
+ comment: No parameters.
sharedName: avoid_returning_null_for_void
problemMessage: "Don't return 'null' from a method with a return type of 'void'."
correctionMessage: "Try removing the 'null'."
hasPublishedDocs: true
avoid_returning_this:
+ comment: No parameters.
problemMessage: "Don't return 'this' from a method."
correctionMessage: "Try changing the return type to 'void' and removing the return."
state:
@@ -2054,6 +2122,7 @@
..write('three');
```
avoid_setters_without_getters:
+ comment: No parameters.
problemMessage: "Setter has no corresponding getter."
correctionMessage: "Try adding a corresponding getter or removing the setter."
state:
@@ -2091,6 +2160,10 @@
}
```
avoid_shadowing_type_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "The type parameter '{0}' shadows a type parameter from the enclosing {1}."
correctionMessage: "Try renaming one of the type parameters."
state:
@@ -2144,6 +2217,9 @@
}
```
avoid_single_cascade_in_expression_statements:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Unnecessary cascade expression."
correctionMessage: "Try using the operator '{0}'."
state:
@@ -2190,6 +2266,7 @@
o.m();
```
avoid_slow_async_io:
+ comment: No parameters.
problemMessage: "Use of an async 'dart:io' method."
correctionMessage: "Try using the synchronous version of the method."
state:
@@ -2274,6 +2351,7 @@
}
```
avoid_type_to_string:
+ comment: No parameters.
problemMessage: "Using 'toString' on a 'Type' is not safe in production code."
correctionMessage: "Try a normal type check or compare the 'runtimeType' directly."
state:
@@ -2352,11 +2430,17 @@
}
```
avoid_types_as_parameter_names_formal_parameter:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: avoid_types_as_parameter_names
problemMessage: "The parameter name '{0}' matches a visible type name."
correctionMessage: "Try adding a name for the parameter or changing the parameter name to not match an existing type."
hasPublishedDocs: true
avoid_types_as_parameter_names_type_parameter:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: avoid_types_as_parameter_names
problemMessage: "The type parameter name '{0}' matches a visible type name."
state:
@@ -2419,6 +2503,7 @@
m(f(int v));
```
avoid_types_on_closure_parameters:
+ comment: No parameters.
problemMessage: "Unnecessary type annotation on a function expression parameter."
correctionMessage: "Try removing the type annotation."
state:
@@ -2442,6 +2527,7 @@
var names = people.map((person) => person.name);
```
avoid_unnecessary_containers:
+ comment: No parameters.
problemMessage: "Unnecessary instance of 'Container'."
correctionMessage: "Try removing the 'Container' (but not its children) from the widget tree."
state:
@@ -2546,6 +2632,7 @@
}
```
avoid_unstable_final_fields:
+ comment: No parameters.
state:
experimental: "3.3"
removed: "3.3"
@@ -2553,6 +2640,9 @@
deprecatedDetails: |-
This rule has been removed.
avoid_unused_constructor_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The parameter '{0}' is not used in the constructor."
correctionMessage: "Try using the parameter or removing it."
state:
@@ -2579,6 +2669,7 @@
}
```
avoid_void_async:
+ comment: No parameters.
problemMessage: "An 'async' function should have a 'Future' return type when it doesn't return a value."
correctionMessage: "Try changing the return type."
state:
@@ -2617,6 +2708,7 @@
}
```
avoid_web_libraries_in_flutter:
+ comment: No parameters.
problemMessage: "Don't use web-only libraries outside Flutter web plugins."
correctionMessage: "Try finding a different library for your needs."
state:
@@ -2687,6 +2779,9 @@
otherwise, imports of `dart:html`, `dart:js` and `dart:js_util` are disallowed.
await_only_futures:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Uses 'await' on an instance of '{0}', which is not a subtype of 'Future'."
correctionMessage: "Try removing the 'await' or changing the expression."
state:
@@ -2750,6 +2845,9 @@
}
```
camel_case_extensions:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The extension name '{0}' isn't an UpperCamelCase identifier."
correctionMessage: "Try changing the name to follow the UpperCamelCase style."
state:
@@ -2805,6 +2903,9 @@
}
```
camel_case_types:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The type name '{0}' isn't an UpperCamelCase identifier."
correctionMessage: "Try changing the name to follow the UpperCamelCase style."
state:
@@ -2855,6 +2956,7 @@
typedef num Adder(num x, num y);
```
cancel_subscriptions:
+ comment: No parameters.
problemMessage: "Uncancelled instance of 'StreamSubscription'."
correctionMessage: "Try invoking 'cancel' in the function in which the 'StreamSubscription' was created."
state:
@@ -2944,6 +3046,7 @@
cancellations. See [linter#317](https://github.com/dart-lang/sdk/issues/57387)
for more information.
cascade_invocations:
+ comment: No parameters.
problemMessage: "Unnecessary duplication of receiver."
correctionMessage: "Try using a cascade to avoid the duplication."
state:
@@ -2988,6 +3091,7 @@
..secondMethod();
```
cast_nullable_to_non_nullable:
+ comment: No parameters.
problemMessage: "Don't cast a nullable value to a non-nullable type."
correctionMessage: "Try adding a not-null assertion ('!') to make the type non-nullable."
state:
@@ -3018,6 +3122,7 @@
var v = a!;
```
close_sinks:
+ comment: No parameters.
problemMessage: "Unclosed instance of 'Sink'."
correctionMessage: "Try invoking 'close' in the function in which the 'Sink' was created."
state:
@@ -3107,6 +3212,10 @@
closures. See [sdk#57882](https://github.com/dart-lang/sdk/issues/57882)
for more information.
collection_methods_unrelated_type:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "The argument type '{0}' isn't related to '{1}'."
correctionMessage: "Try changing the argument or element type to match."
state:
@@ -3208,6 +3317,7 @@
}
```
combinators_ordering:
+ comment: No parameters.
problemMessage: "Sort combinator names alphabetically."
correctionMessage: "Try sorting the combinator names alphabetically."
state:
@@ -3229,6 +3339,7 @@
export 'a.dart' show A, B hide C, D;
```
comment_references:
+ comment: No parameters.
problemMessage: "The referenced name isn't visible in scope."
correctionMessage: "Try adding an import for the referenced name."
state:
@@ -3289,6 +3400,9 @@
[sdk#57783](https://github.com/dart-lang/sdk/issues/57783) for more
information.
conditional_uri_does_not_exist:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The target of the conditional URI '{0}' doesn't exist."
correctionMessage: "Try creating the file referenced by the URI, or try using a URI for a file that does exist."
state:
@@ -3313,6 +3427,9 @@
if (condition) 'file_that_also_does_exist.dart';
```
constant_identifier_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The constant name '{0}' isn't a lowerCamelCase identifier."
correctionMessage: "Try changing the name to follow the lowerCamelCase style."
state:
@@ -3371,6 +3488,9 @@
}
```
control_flow_in_finally:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use of '{0}' in a 'finally' clause."
correctionMessage: "Try restructuring the code."
state:
@@ -3500,6 +3620,9 @@
}
```
curly_braces_in_flow_control_structures:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Statements in {0} should be enclosed in a block."
correctionMessage: "Try wrapping the statement in a block."
state:
@@ -3576,6 +3699,7 @@
}
```
dangling_library_doc_comments:
+ comment: No parameters.
problemMessage: "Dangling library doc comment."
correctionMessage: "Add a 'library' directive after the library comment."
state:
@@ -3661,6 +3785,9 @@
2.19 and later. Code which might run in earlier versions of Dart will need to
provide a name in the `library` directive.
depend_on_referenced_packages:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The imported package '{0}' isn't a dependency of the importing package."
correctionMessage: "Try adding a dependency for '{0}' in the 'pubspec.yaml' file."
state:
@@ -3752,6 +3879,7 @@
a: ^1.0.0
```
deprecated_consistency_constructor:
+ comment: No parameters.
sharedName: deprecated_consistency
problemMessage: "Constructors in a deprecated class should be deprecated."
correctionMessage: "Try marking the constructor as deprecated."
@@ -3801,16 +3929,22 @@
}
```
deprecated_consistency_field:
+ comment: No parameters.
sharedName: deprecated_consistency
problemMessage: "Fields that are initialized by a deprecated parameter should be deprecated."
correctionMessage: "Try marking the field as deprecated."
hasPublishedDocs: false
deprecated_consistency_parameter:
+ comment: No parameters.
sharedName: deprecated_consistency
problemMessage: "Parameters that initialize a deprecated field should be deprecated."
correctionMessage: "Try marking the parameter as deprecated."
hasPublishedDocs: false
deprecated_member_use_from_same_package_with_message:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: deprecated_member_use_from_same_package
problemMessage: "'{0}' is deprecated and shouldn't be used. {1}"
correctionMessage: "Try replacing the use of the deprecated member with the replacement, if a replacement is specified."
@@ -3876,11 +4010,15 @@
}
```
deprecated_member_use_from_same_package_without_message:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: deprecated_member_use_from_same_package
problemMessage: "'{0}' is deprecated and shouldn't be used."
correctionMessage: "Try replacing the use of the deprecated member with the replacement, if a replacement is specified."
hasPublishedDocs: false
diagnostic_describe_all_properties:
+ comment: No parameters.
problemMessage: "The public property isn't described by either 'debugFillProperties' or 'debugDescribeChildren'."
correctionMessage: "Try describing the property."
state:
@@ -3991,6 +4129,7 @@
}
```
directives_ordering_alphabetical:
+ comment: No parameters.
sharedName: directives_ordering
problemMessage: "Sort directive sections alphabetically."
correctionMessage: "Try sorting the directives."
@@ -4097,21 +4236,29 @@
import 'a/b.dart'; // OK
```
directives_ordering_dart:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: directives_ordering
problemMessage: "Place 'dart:' {0} before other {0}."
correctionMessage: "Try sorting the directives."
hasPublishedDocs: false
directives_ordering_exports:
+ comment: No parameters.
sharedName: directives_ordering
problemMessage: "Specify exports in a separate section after all imports."
correctionMessage: "Try sorting the directives."
hasPublishedDocs: false
directives_ordering_package_before_relative:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: directives_ordering
problemMessage: "Place 'package:' {0} before relative {0}."
correctionMessage: "Try sorting the directives."
hasPublishedDocs: false
discarded_futures:
+ comment: No parameters.
problemMessage: "'Future'-returning calls in a non-'async' function."
correctionMessage: "Try converting the enclosing function to be 'async' and then 'await' the future, or wrap the expression in 'unawaited'."
state:
@@ -4149,6 +4296,7 @@
Future<void> createDir(String path) async {}
```
do_not_use_environment:
+ comment: No parameters.
problemMessage: "Invalid use of an environment declaration."
correctionMessage: "Try removing the environment declaration usage."
state:
@@ -4167,6 +4315,7 @@
bool.hasEnvironment('logging') ? String.fromEnvironment('logging') : null;
```
document_ignores:
+ comment: No parameters.
problemMessage: "Missing documentation explaining why the diagnostic is ignored."
correctionMessage: "Try adding a comment immediately above the ignore comment."
state:
@@ -4189,6 +4338,7 @@
int _x = 1;
```
empty_catches:
+ comment: No parameters.
problemMessage: "Empty catch block."
correctionMessage: "Try adding statements to the block, adding a comment to the block, or removing the 'catch' clause."
state:
@@ -4288,6 +4438,7 @@
}
```
empty_constructor_bodies:
+ comment: No parameters.
problemMessage: "Empty constructor bodies should be written using a ';' rather than '{}'."
correctionMessage: "Try replacing the constructor body with ';'."
state:
@@ -4345,6 +4496,7 @@
}
```
empty_statements:
+ comment: No parameters.
problemMessage: "Unnecessary empty statement."
correctionMessage: "Try removing the empty statement or restructuring the code."
state:
@@ -4440,6 +4592,7 @@
bar();
```
enable_null_safety:
+ comment: No parameters.
state:
stable: "2.19"
removed: "3.0"
@@ -4462,6 +4615,7 @@
}
```
eol_at_end_of_file:
+ comment: No parameters.
problemMessage: "Missing a newline at the end of the file."
correctionMessage: "Try adding a newline at the end of the file."
state:
@@ -4484,6 +4638,7 @@
<-- newline
```
erase_dart_type_extension_types:
+ comment: No parameters.
problemMessage: "Unsafe use of 'DartType' in an 'is' check."
correctionMessage: "Ensure DartType extension types are erased by using a helper method."
state:
@@ -4497,6 +4652,9 @@
**For internal use only.**
exhaustive_cases:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Missing case clauses for some constants in '{0}'."
correctionMessage: "Try adding case clauses for the missing constants."
state:
@@ -4564,6 +4722,9 @@
}
```
file_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The file name '{0}' isn't a lower_case_with_underscores identifier."
correctionMessage: "Try changing the name to follow the lower_case_with_underscores style."
state:
@@ -4615,6 +4776,7 @@
The lint `library_names` can be used to enforce the same kind of naming on the
library.
flutter_style_todos:
+ comment: No parameters.
problemMessage: "To-do comment doesn't follow the Flutter style."
correctionMessage: "Try following the Flutter style for to-do comments."
state:
@@ -4640,6 +4802,10 @@
// TODO(username): message, https://URL-to-issue.
```
hash_and_equals:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "Missing a corresponding override of '{0}'."
correctionMessage: "Try overriding '{0}' or removing '{1}'."
state:
@@ -4747,6 +4913,7 @@
}
```
implementation_imports:
+ comment: No parameters.
problemMessage: "Import of a library in the 'lib/src' directory of another package."
correctionMessage: "Try importing a public library that exports this library, or removing the import."
state:
@@ -4807,6 +4974,7 @@
import 'package:acme/src/internals.dart';
```
implicit_call_tearoffs:
+ comment: No parameters.
problemMessage: "Implicit tear-off of the 'call' method."
correctionMessage: "Try explicitly tearing off the 'call' method."
state:
@@ -4886,6 +5054,12 @@
callIt(Callable().call);
```
implicit_reopen:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
+ 2: undocumented
+ 3: undocumented
problemMessage: "The {0} '{1}' reopens '{2}' because it is not marked '{3}'."
correctionMessage: "Try marking '{1}' '{3}' or annotating it with '@reopen'."
state:
@@ -4928,6 +5102,7 @@
class C extends I {}
```
invalid_case_patterns:
+ comment: No parameters.
problemMessage: "This expression is not valid in a 'case' clause in Dart 3.0."
correctionMessage: "Try refactoring the expression to be valid in 3.0."
state:
@@ -5158,6 +5333,10 @@
}
```
invalid_runtime_check_with_js_interop_types_dart_as_js:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Cast from '{0}' to '{1}' casts a Dart value to a JS interop type, which might not be platform-consistent."
correctionMessage: "Try using conversion methods from 'dart:js_interop' to convert between Dart types and JS interop types."
@@ -5319,33 +5498,58 @@
}
```
invalid_runtime_check_with_js_interop_types_dart_is_js:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Runtime check between '{0}' and '{1}' checks whether a Dart value is a JS interop type, which might not be platform-consistent."
hasPublishedDocs: false
invalid_runtime_check_with_js_interop_types_js_as_dart:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Cast from '{0}' to '{1}' casts a JS interop value to a Dart type, which might not be platform-consistent."
correctionMessage: "Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types."
hasPublishedDocs: false
invalid_runtime_check_with_js_interop_types_js_as_incompatible_js:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Cast from '{0}' to '{1}' casts a JS interop value to an incompatible JS interop type, which might not be platform-consistent."
hasPublishedDocs: false
invalid_runtime_check_with_js_interop_types_js_is_dart:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Runtime check between '{0}' and '{1}' checks whether a JS interop value is a Dart type, which might not be platform-consistent."
hasPublishedDocs: false
invalid_runtime_check_with_js_interop_types_js_is_inconsistent_js:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Runtime check between '{0}' and '{1}' involves a non-trivial runtime check between two JS interop types that might not be platform-consistent."
correctionMessage: "Try using a JS interop member like 'isA' from 'dart:js_interop' to check the underlying type of JS interop values."
hasPublishedDocs: false
invalid_runtime_check_with_js_interop_types_js_is_unrelated_js:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: invalid_runtime_check_with_js_interop_types
problemMessage: "Runtime check between '{0}' and '{1}' involves a runtime check between a JS interop value and an unrelated JS interop type that will always be true and won't check the underlying type."
correctionMessage: "Try using a JS interop member like 'isA' from 'dart:js_interop' to check the underlying type of JS interop values, or make the JS interop type a supertype using 'implements'."
hasPublishedDocs: false
invariant_booleans:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.0"
@@ -5432,6 +5636,7 @@
}
```
iterable_contains_unrelated_type:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.3"
@@ -5545,6 +5750,7 @@
class DerivedClass3 extends ClassBase implements Mixin {}
```
join_return_with_assignment:
+ comment: No parameters.
problemMessage: "Assignment could be inlined in 'return' statement."
correctionMessage: "Try inlining the assigned value in the 'return' statement."
state:
@@ -5573,6 +5779,7 @@
}
```
leading_newlines_in_multiline_strings:
+ comment: No parameters.
problemMessage: "Missing a newline at the beginning of a multiline string."
correctionMessage: "Try adding a newline at the beginning of the string."
state:
@@ -5602,6 +5809,7 @@
var s2 = '''This one-liner multiline string is ok. It usually allows to escape both ' and " in the string.''';
```
library_annotations:
+ comment: No parameters.
problemMessage: "This annotation should be attached to a library directive."
correctionMessage: "Try attaching the annotation to a library directive."
state:
@@ -5668,6 +5876,9 @@
2.19 and later. Code which might run in earlier versions of Dart will need to
provide a name in the `library` directive.
library_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The library name '{0}' isn't a lower_case_with_underscores identifier."
correctionMessage: "Try changing the name to follow the lower_case_with_underscores style."
state:
@@ -5725,6 +5936,9 @@
The lint `file_names` can be used to enforce the same kind of naming on the
file.
library_prefixes:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The prefix '{0}' isn't a lower_case_with_underscores identifier."
correctionMessage: "Try changing the prefix to follow the lower_case_with_underscores style."
state:
@@ -5773,6 +5987,7 @@
import 'package:javascript_utils/javascript_utils.dart' as js_utils;
```
library_private_types_in_public_api:
+ comment: No parameters.
problemMessage: "Invalid use of a private type in a public API."
correctionMessage: "Try making the private type public, or making the API that uses the private type also be private."
state:
@@ -5845,6 +6060,7 @@
f(String s) { ... }
```
lines_longer_than_80_chars:
+ comment: No parameters.
problemMessage: "The line length exceeds the 80-character limit."
correctionMessage: "Try breaking the line across multiple lines."
state:
@@ -5873,6 +6089,7 @@
if they go over the line limit. This makes it easier to search source files for
a given path.
list_remove_unrelated_type:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.3"
@@ -5987,6 +6204,7 @@
class DerivedClass3 extends ClassBase implements Mixin {}
```
literal_only_boolean_expressions:
+ comment: No parameters.
problemMessage: "The Boolean expression has a constant value."
correctionMessage: "Try changing the expression."
state:
@@ -6128,6 +6346,10 @@
}
```
matching_super_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "The super parameter named '{0}'' does not share the same name as the corresponding parameter in the super constructor, '{1}'."
correctionMessage: "Try using the name of the corresponding parameter in the super constructor."
state:
@@ -6180,6 +6402,7 @@
}
```
missing_code_block_language_in_doc_comment:
+ comment: No parameters.
problemMessage: "The code block is missing a specified language."
correctionMessage: "Try adding a language to the code block."
state:
@@ -6214,6 +6437,7 @@
class A {}
```
missing_whitespace_between_adjacent_strings:
+ comment: No parameters.
problemMessage: "Missing whitespace between adjacent strings."
correctionMessage: "Try adding whitespace between the strings."
state:
@@ -6270,6 +6494,7 @@
'do eiusmod tempor incididunt ut labore et dolore magna';
```
no_adjacent_strings_in_list:
+ comment: No parameters.
problemMessage: "Don't use adjacent strings in a list literal."
correctionMessage: "Try adding a comma between the strings."
state:
@@ -6337,6 +6562,7 @@
];
```
no_default_cases:
+ comment: No parameters.
problemMessage: "Invalid use of 'default' member in a switch."
correctionMessage: "Try enumerating all the possible values of the switch expression."
state:
@@ -6377,6 +6603,10 @@
return null;
```
no_duplicate_case_values:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
problemMessage: "The value of the case clause ('{0}') is equal to the value of an earlier case clause ('{1}')."
correctionMessage: "Try removing or changing the value."
state:
@@ -6467,6 +6697,9 @@
and below. In Dart 3.0 and after, duplicate cases are reported as dead code
by the analyzer.
no_leading_underscores_for_library_prefixes:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The library prefix '{0}' starts with an underscore."
correctionMessage: "Try renaming the prefix to not start with an underscore."
state:
@@ -6514,6 +6747,9 @@
import 'dart:core' as core;
```
no_leading_underscores_for_local_identifiers:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The local variable '{0}' starts with an underscore."
correctionMessage: "Try renaming the variable to not start with an underscore."
state:
@@ -6581,6 +6817,7 @@
[1,2,3].map((_) => print('Hello'));
```
no_literal_bool_comparisons:
+ comment: No parameters.
problemMessage: "Unnecessary comparison to a boolean literal."
correctionMessage: "Remove the comparison and use the negate `!` operator if necessary."
state:
@@ -6614,6 +6851,7 @@
}
```
no_logic_in_create_state:
+ comment: No parameters.
problemMessage: "Don't put any logic in 'createState'."
correctionMessage: "Try moving the logic out of 'createState'."
state:
@@ -6712,6 +6950,7 @@
}
```
no_runtimeType_toString:
+ comment: No parameters.
problemMessage: "Using 'toString' on a 'Type' is not safe in production code."
correctionMessage: "Try removing the usage of 'toString' or restructuring the code."
state:
@@ -6745,6 +6984,7 @@
* in a mixin declaration
* in an abstract class declaration
no_self_assignments:
+ comment: No parameters.
problemMessage: "The variable or property is being assigned to itself."
correctionMessage: "Try removing the assignment that has no direct effect."
state:
@@ -6851,6 +7091,7 @@
}
```
no_wildcard_variable_uses:
+ comment: No parameters.
problemMessage: "The referenced identifier is a wildcard."
correctionMessage: "Use an identifier name that is not a wildcard."
state:
@@ -6939,6 +7180,9 @@
var [a, _, b, _] = [1, 2, 3, 4];
```
non_constant_identifier_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The variable name '{0}' isn't a lowerCamelCase identifier."
correctionMessage: "Try changing the name to follow the lowerCamelCase style."
state:
@@ -6988,6 +7232,7 @@
}
```
noop_primitive_operations:
+ comment: No parameters.
problemMessage: "The expression has no effect and can be removed."
correctionMessage: "Try removing the expression."
state:
@@ -7032,6 +7277,7 @@
'';
```
null_check_on_nullable_type_parameter:
+ comment: No parameters.
problemMessage: "The null check operator shouldn't be used on a variable whose type is a potentially nullable type parameter."
correctionMessage: "Try explicitly testing for 'null'."
state:
@@ -7100,6 +7346,7 @@
}
```
null_closures:
+ comment: No parameters.
problemMessage: "Closure can't be 'null' because it might be invoked."
correctionMessage: "Try providing a non-null closure."
state:
@@ -7173,6 +7420,7 @@
[1, 3, 5].firstWhere((e) => e.isOdd, orElse: () => null);
```
omit_local_variable_types:
+ comment: No parameters.
problemMessage: "Unnecessary type annotation on a local variable."
correctionMessage: "Try removing the type annotation."
state:
@@ -7229,6 +7477,7 @@
}
```
omit_obvious_local_variable_types:
+ comment: No parameters.
problemMessage: "Omit the type annotation on a local variable when the type is obvious."
correctionMessage: "Try removing the type annotation."
state:
@@ -7300,6 +7549,7 @@
or removed. Feedback on its behavior is welcome! The main issue is here:
https://github.com/dart-lang/sdk/issues/58773.
omit_obvious_property_types:
+ comment: No parameters.
problemMessage: "The type annotation isn't needed because it is obvious."
correctionMessage: "Try removing the type annotation."
state:
@@ -7351,6 +7601,9 @@
or removed. Feedback on its behavior is welcome! The main issue is here:
https://github.com/dart-lang/sdk/issues/59550.
one_member_abstracts:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Unnecessary use of an abstract class."
correctionMessage: "Try making '{0}' a top-level function and removing the class."
state:
@@ -7380,6 +7633,7 @@
typedef Predicate = bool Function(item);
```
only_throw_errors:
+ comment: No parameters.
problemMessage: "Don't throw instances of classes that don't extend either 'Exception' or 'Error'."
correctionMessage: "Try throwing a different class of object."
state:
@@ -7432,6 +7686,9 @@
}
```
overridden_fields:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Field overrides a field inherited from '{0}'."
correctionMessage: "Try removing the field, overriding the getter and setter if necessary."
state:
@@ -7545,6 +7802,7 @@
}
```
package_api_docs:
+ comment: No parameters.
problemMessage: "Missing documentation for public API."
correctionMessage: "Try adding a documentation comment."
state:
@@ -7602,6 +7860,9 @@
Advice for writing good doc comments can be found in the
[Doc Writing Guidelines](https://dart.dev/effective-dart/documentation).
package_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The package name '{0}' isn't a lower_case_with_underscores identifier."
correctionMessage: "Try changing the name to follow the lower_case_with_underscores style."
state:
@@ -7641,6 +7902,9 @@
Also, make sure the name is a valid Dart identifier -- that it doesn't start
with digits and isn't a reserved word.
package_prefixed_library_names:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The library name is not a dot-separated path prefixed by the package name."
correctionMessage: "Try changing the name to '{0}'."
state:
@@ -7727,6 +7991,9 @@
library my_package.src.private;
```
parameter_assignments:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Invalid assignment to the parameter '{0}'."
correctionMessage: "Try using a local variable in place of the parameter."
state:
@@ -7800,6 +8067,7 @@
}
```
prefer_adjacent_string_concatenation:
+ comment: No parameters.
problemMessage: "String literals shouldn't be concatenated by the '+' operator."
correctionMessage: "Try removing the operator to use adjacent strings."
state:
@@ -7845,6 +8113,7 @@
'parts are overrun by martians. Unclear which are which.');
```
prefer_asserts_in_initializer_lists:
+ comment: No parameters.
problemMessage: "Assert should be in the initializer list."
correctionMessage: "Try moving the assert to the initializer list."
state:
@@ -7899,6 +8168,7 @@
}
```
prefer_asserts_with_message:
+ comment: No parameters.
problemMessage: "Missing a message in an assert."
correctionMessage: "Try adding a message to the assert."
state:
@@ -7957,6 +8227,7 @@
}
```
prefer_bool_in_asserts:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.0"
@@ -7985,6 +8256,7 @@
}());
```
prefer_collection_literals:
+ comment: No parameters.
problemMessage: "Unnecessary constructor invocation."
correctionMessage: "Try using a collection literal."
state:
@@ -8056,6 +8328,7 @@
void printHashMap(LinkedHashMap map) => printMap(map);
```
prefer_conditional_assignment:
+ comment: No parameters.
problemMessage: "The 'if' statement could be replaced by a null-aware assignment."
correctionMessage: "Try using the '??=' operator to conditionally assign a value."
state:
@@ -8117,6 +8390,7 @@
}
```
prefer_const_constructors:
+ comment: No parameters.
problemMessage: "Use 'const' with the constructor to improve performance."
correctionMessage: "Try adding the 'const' keyword to the constructor invocation."
state:
@@ -8204,6 +8478,7 @@
A foo(int x) => new A(x);
```
prefer_const_constructors_in_immutables:
+ comment: No parameters.
problemMessage: "Constructors in '@immutable' classes should be declared as 'const'."
correctionMessage: "Try adding 'const' to the constructor declaration."
state:
@@ -8281,6 +8556,7 @@
}
```
prefer_const_declarations:
+ comment: No parameters.
problemMessage: "Use 'const' for final variables initialized to a constant value."
correctionMessage: "Try replacing 'final' with 'const'."
state:
@@ -8356,6 +8632,7 @@
}
```
prefer_const_literals_to_create_immutables:
+ comment: No parameters.
problemMessage: "Use 'const' literals as arguments to constructors of '@immutable' classes."
correctionMessage: "Try adding 'const' before the literal."
state:
@@ -8460,6 +8737,7 @@
A a2 = new A(const {});
```
prefer_constructors_over_static_methods:
+ comment: No parameters.
problemMessage: "Static method should be a constructor."
correctionMessage: "Try converting the method into a constructor."
state:
@@ -8525,6 +8803,7 @@
}
```
prefer_contains_always_false:
+ comment: No parameters.
sharedName: prefer_contains
problemMessage: "Always 'false' because 'indexOf' is always greater than or equal to -1."
categories: [style]
@@ -8533,6 +8812,7 @@
TODO(brianwilkerson): Should be warning rather than lint,
as represents a bug rather than style preference.
prefer_contains_always_true:
+ comment: No parameters.
sharedName: prefer_contains
problemMessage: "Always 'true' because 'indexOf' is always greater than or equal to -1."
hasPublishedDocs: false
@@ -8540,6 +8820,7 @@
TODO(brianwilkerson): Should be warning rather than lint,
as represents a bug rather than style preference.
prefer_contains_use_contains:
+ comment: No parameters.
sharedName: prefer_contains
problemMessage: "Unnecessary use of 'indexOf' to test for containment."
correctionMessage: "Try using 'contains'."
@@ -8595,6 +8876,7 @@
if (!lunchBox.contains('sandwich')) return 'so hungry...';
```
prefer_double_quotes:
+ comment: No parameters.
problemMessage: "Unnecessary use of single quotes."
correctionMessage: "Try using double quotes unless the string contains double quotes."
state:
@@ -8659,6 +8941,7 @@
"and nested \${a ? 'strings' : 'can be double quoted themselves'}");
```
prefer_equal_for_default_values:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.0"
@@ -8678,6 +8961,7 @@
m({a = 1})
```
prefer_expression_function_bodies:
+ comment: No parameters.
problemMessage: "Unnecessary use of a block function body."
correctionMessage: "Try using an expression function body."
state:
@@ -8749,6 +9033,9 @@
containsValue(String value) => getValues().contains(value);
```
prefer_final_fields:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The private field {0} could be 'final'."
correctionMessage: "Try making the field 'final'."
state:
@@ -8856,6 +9143,7 @@
}
```
prefer_final_in_for_each_pattern:
+ comment: No parameters.
sharedName: prefer_final_in_for_each
problemMessage: "The pattern should be final."
correctionMessage: "Try making the pattern final."
@@ -8924,11 +9212,15 @@
}
```
prefer_final_in_for_each_variable:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: prefer_final_in_for_each
problemMessage: "The variable '{0}' should be final."
correctionMessage: "Try making the variable final."
hasPublishedDocs: false
prefer_final_locals:
+ comment: No parameters.
problemMessage: "Local variables should be final."
correctionMessage: "Try making the variable final."
state:
@@ -8997,6 +9289,9 @@
}
```
prefer_final_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The parameter '{0}' should be final."
correctionMessage: "Try making the parameter final."
state:
@@ -9075,6 +9370,7 @@
}
```
prefer_for_elements_to_map_fromIterable:
+ comment: No parameters.
problemMessage: "Use 'for' elements when building maps from iterables."
correctionMessage: "Try using a collection literal with a 'for' element."
state:
@@ -9153,6 +9449,7 @@
};
```
prefer_foreach:
+ comment: No parameters.
problemMessage: "Use 'forEach' and a tear-off rather than a 'for' loop to apply a function to every element."
correctionMessage: "Try using 'forEach' and a tear-off rather than a 'for' loop."
state:
@@ -9219,6 +9516,7 @@
myList.forEach(foo().f); // But this one invokes foo() just once.
```
prefer_function_declarations_over_variables:
+ comment: No parameters.
problemMessage: "Use a function declaration rather than a variable assignment to bind a function to a name."
correctionMessage: "Try rewriting the closure assignment as a function declaration."
state:
@@ -9279,6 +9577,9 @@
}
```
prefer_generic_function_type_aliases:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use the generic function type syntax in 'typedef's."
correctionMessage: "Try using the generic function type syntax ('{0}')."
state:
@@ -9329,6 +9630,7 @@
typedef F = void Function();
```
prefer_if_elements_to_conditional_expressions:
+ comment: No parameters.
problemMessage: "Use an 'if' element to conditionally add elements."
correctionMessage: "Try using an 'if' element rather than a conditional expression."
state:
@@ -9349,6 +9651,7 @@
var list = ['a', 'b', if (condition) 'c'];
```
prefer_if_null_operators:
+ comment: No parameters.
problemMessage: "Use the '??' operator rather than '?:' when testing for 'null'."
correctionMessage: "Try rewriting the code to use '??'."
state:
@@ -9393,6 +9696,9 @@
v = a ?? b;
```
prefer_initializing_formals:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use an initializing formal to assign a parameter to a field."
correctionMessage: "Try using an initialing formal ('this.{0}') to initialize the field."
state:
@@ -9502,6 +9808,7 @@
}
```
prefer_inlined_adds_multiple:
+ comment: No parameters.
sharedName: prefer_inlined_adds
problemMessage: "The addition of multiple list items could be inlined."
correctionMessage: "Try adding the items to the list literal directly."
@@ -9526,6 +9833,7 @@
var l2 = ['a', 'b', 'c'];
```
prefer_inlined_adds_single:
+ comment: No parameters.
sharedName: prefer_inlined_adds
problemMessage: "The addition of a list item could be inlined."
correctionMessage: "Try adding the item to the list literal directly."
@@ -9579,6 +9887,7 @@
}
```
prefer_int_literals:
+ comment: No parameters.
problemMessage: "Unnecessary use of a 'double' literal."
correctionMessage: "Try using an 'int' literal."
state:
@@ -9606,6 +9915,7 @@
}
```
prefer_interpolation_to_compose_strings:
+ comment: No parameters.
problemMessage: "Use interpolation to compose strings and values."
correctionMessage: "Try using string interpolation to build the composite string."
state:
@@ -9655,6 +9965,7 @@
'Hello, ${person.name} from ${person.city}.'
```
prefer_is_empty_always_false:
+ comment: No parameters.
sharedName: prefer_is_empty
problemMessage: "The comparison is always 'false' because the length is always greater than or equal to 0."
categories: [errorProne]
@@ -9663,6 +9974,7 @@
TODO(brianwilkerson): Should be warning rather than lint,
as represents a bug rather than style preference.
prefer_is_empty_always_true:
+ comment: No parameters.
sharedName: prefer_is_empty
problemMessage: "The comparison is always 'true' because the length is always greater than or equal to 0."
hasPublishedDocs: false
@@ -9670,6 +9982,7 @@
TODO(brianwilkerson): Should be warning rather than lint,
as represents a bug rather than style preference.
prefer_is_empty_use_is_empty:
+ comment: No parameters.
sharedName: prefer_is_empty
problemMessage: "Use 'isEmpty' instead of 'length' to test whether the collection is empty."
correctionMessage: "Try rewriting the expression to use 'isEmpty'."
@@ -9722,11 +10035,13 @@
if (words.isNotEmpty) return words.join(' ');
```
prefer_is_empty_use_is_not_empty:
+ comment: No parameters.
sharedName: prefer_is_empty
problemMessage: "Use 'isNotEmpty' instead of 'length' to test whether the collection is empty."
correctionMessage: "Try rewriting the expression to use 'isNotEmpty'."
hasPublishedDocs: true
prefer_is_not_empty:
+ comment: No parameters.
problemMessage: "Use 'isNotEmpty' rather than negating the result of 'isEmpty'."
correctionMessage: "Try rewriting the expression to use 'isNotEmpty'."
state:
@@ -9775,6 +10090,7 @@
}
```
prefer_is_not_operator:
+ comment: No parameters.
problemMessage: "Use the 'is!' operator rather than negating the value of the 'is' operator."
correctionMessage: "Try rewriting the condition to use the 'is!' operator."
state:
@@ -9830,6 +10146,7 @@
}
```
prefer_iterable_whereType:
+ comment: No parameters.
problemMessage: "Use 'whereType' to select elements of a given type."
correctionMessage: "Try rewriting the expression to use 'whereType'."
state:
@@ -9874,6 +10191,9 @@
iterable.whereType<MyClass>();
```
prefer_mixin:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Only mixins should be mixed in."
correctionMessage: "Try converting '{0}' to a mixin."
state:
@@ -9898,6 +10218,7 @@
class C with M {}
```
prefer_null_aware_method_calls:
+ comment: No parameters.
problemMessage: "Use a null-aware invocation of the 'call' method rather than explicitly testing for 'null'."
correctionMessage: "Try using '?.call()' to invoke the function."
state:
@@ -9918,6 +10239,7 @@
f?.call();
```
prefer_null_aware_operators:
+ comment: No parameters.
problemMessage: "Use the null-aware operator '?.' rather than an explicit 'null' comparison."
correctionMessage: "Try using '?.'."
state:
@@ -9966,6 +10288,7 @@
v = a?.b;
```
prefer_relative_imports:
+ comment: No parameters.
problemMessage: "Use relative imports for files in the 'lib' directory."
correctionMessage: "Try converting the URI to a relative URI."
state:
@@ -10013,6 +10336,7 @@
import 'bar.dart';
```
prefer_single_quotes:
+ comment: No parameters.
problemMessage: "Unnecessary use of double quotes."
correctionMessage: "Try using single quotes unless the string contains single quotes."
state:
@@ -10077,6 +10401,7 @@
'and nested \${a ? "strings" : "can be double quoted themselves"}');
```
prefer_spread_collections:
+ comment: No parameters.
problemMessage: "The addition of multiple elements could be inlined."
correctionMessage: "Try using the spread operator ('...') to inline the addition."
state:
@@ -10140,6 +10465,7 @@
var l = ['a', ...?things];
```
prefer_typing_uninitialized_variables_for_field:
+ comment: No parameters.
sharedName: prefer_typing_uninitialized_variables
problemMessage: "An uninitialized field should have an explicit type annotation."
correctionMessage: "Try adding a type annotation."
@@ -10235,11 +10561,13 @@
}
```
prefer_typing_uninitialized_variables_for_local_variable:
+ comment: No parameters.
sharedName: prefer_typing_uninitialized_variables
problemMessage: "An uninitialized variable should have an explicit type annotation."
correctionMessage: "Try adding a type annotation."
hasPublishedDocs: true
prefer_void_to_null:
+ comment: No parameters.
problemMessage: "Unnecessary use of the type 'Null'."
correctionMessage: "Try using 'void' instead."
state:
@@ -10302,6 +10630,7 @@
<int, Null>{};
```
provide_deprecation_message:
+ comment: No parameters.
problemMessage: "Missing a deprecation message."
correctionMessage: "Try using the constructor to provide a message ('@Deprecated(\"message\")')."
state:
@@ -10352,6 +10681,7 @@
void oldFunction(arg1, arg2) {}
```
public_member_api_docs:
+ comment: No parameters.
problemMessage: "Missing documentation for a public member."
correctionMessage: "Try adding documentation for the member."
state:
@@ -10428,6 +10758,9 @@
documented getters have corresponding undocumented setters. In this case the
setters inherit the docs from the getters.
recursive_getters:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The getter '{0}' recursively returns itself."
correctionMessage: "Try changing the value being returned."
state:
@@ -10487,6 +10820,7 @@
int get field => _field;
```
require_trailing_commas:
+ comment: No parameters.
problemMessage: "Missing a required trailing comma."
correctionMessage: "Try adding a trailing comma."
state:
@@ -10525,6 +10859,9 @@
**NOTE:** This lint rule assumes that code has been formatted with `dart format`
and may produce false positives on unformatted code.
secure_pubspec_urls:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The '{0}' protocol shouldn't be used because it isn't secure."
correctionMessage: "Try using a secure protocol, such as 'https'."
state:
@@ -10577,6 +10914,7 @@
repository: https://github.com/dart-lang/example
```
sized_box_for_whitespace:
+ comment: No parameters.
problemMessage: "Use a 'SizedBox' to add whitespace to a layout."
correctionMessage: "Try using a 'SizedBox' rather than a 'Container'."
state:
@@ -10671,6 +11009,9 @@
}
```
sized_box_shrink_expand:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use 'SizedBox.{0}' to avoid needing to specify the 'height' and 'width'."
correctionMessage: "Try using 'SizedBox.{0}' and removing the 'height' and 'width' arguments."
state:
@@ -10789,6 +11130,7 @@
}
```
slash_for_doc_comments:
+ comment: No parameters.
problemMessage: "Use the end-of-line form ('///') for doc comments."
correctionMessage: "Try rewriting the comment to use '///'."
state:
@@ -10843,6 +11185,9 @@
Within a doc comment, you can use markdown for formatting.
sort_child_properties_last:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "The '{0}' argument should be last in widget constructor invocations."
correctionMessage: "Try moving the argument to the end of the argument list."
state:
@@ -10955,6 +11300,7 @@
Exception: It's allowed to have parameter with a function expression after the
`child` property.
sort_constructors_first:
+ comment: No parameters.
problemMessage: "Constructor declarations should be before non-constructor declarations."
correctionMessage: "Try moving the constructor declaration before all other members."
state:
@@ -11012,6 +11358,7 @@
}
```
sort_pub_dependencies:
+ comment: No parameters.
problemMessage: "Dependencies not sorted alphabetically."
correctionMessage: "Try sorting the dependencies alphabetically (A to Z)."
state:
@@ -11051,6 +11398,7 @@
Sorting list of pub dependencies makes maintenance easier.
sort_unnamed_constructors_first:
+ comment: No parameters.
problemMessage: "Invalid location for the unnamed constructor."
correctionMessage: "Try moving the unnamed constructor before all other constructors."
state:
@@ -11108,6 +11456,7 @@
}
```
specify_nonobvious_local_variable_types:
+ comment: No parameters.
problemMessage: "Specify the type of a local variable when the type is non-obvious."
correctionMessage: "Try adding a type annotation."
state:
@@ -11190,6 +11539,7 @@
or removed. Feedback on its behavior is welcome! The main issue is here:
https://github.com/dart-lang/sdk/issues/58773.
specify_nonobvious_property_types:
+ comment: No parameters.
problemMessage: "A type annotation is needed because it isn't obvious."
correctionMessage: "Try adding a type annotation."
state:
@@ -11260,6 +11610,7 @@
or removed. Feedback on its behavior is welcome! The main issue is here:
https://github.com/dart-lang/sdk/issues/59550.
strict_top_level_inference_add_type:
+ comment: No parameters.
sharedName: strict_top_level_inference
problemMessage: "Missing type annotation."
correctionMessage: "Try adding a type annotation."
@@ -11310,16 +11661,21 @@
int _sq(int v) => v * v;
```
strict_top_level_inference_replace_keyword:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: strict_top_level_inference
problemMessage: "Missing type annotation."
correctionMessage: "Try replacing '{0}' with a type annotation."
hasPublishedDocs: false
strict_top_level_inference_split_to_types:
+ comment: No parameters.
sharedName: strict_top_level_inference
problemMessage: "Missing type annotation."
correctionMessage: "Try splitting the declaration and specify the different type annotations."
hasPublishedDocs: false
super_goes_last:
+ comment: No parameters.
state:
stable: "2.0"
removed: "3.0"
@@ -11357,6 +11713,7 @@
super(style) {
```
switch_on_type:
+ comment: No parameters.
problemMessage: "Avoid switch statements on a 'Type'."
correctionMessage: "Try using pattern matching on a variable instead."
state:
@@ -11433,6 +11790,9 @@
}
```
test_types_in_equals:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Missing type test for '{0}' in '=='."
correctionMessage: "Try testing the type of '{0}'."
state:
@@ -11535,6 +11895,9 @@
}
```
throw_in_finally:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use of '{0}' in 'finally' block."
correctionMessage: "Try moving the '{0}' outside the 'finally' block."
state:
@@ -11615,6 +11978,7 @@
}
```
tighten_type_of_initializing_formals:
+ comment: No parameters.
problemMessage: "Use a type annotation rather than 'assert' to enforce non-nullability."
correctionMessage: "Try adding a type annotation and removing the 'assert'."
state:
@@ -11685,6 +12049,7 @@
}
```
type_annotate_public_apis:
+ comment: No parameters.
problemMessage: "Missing type annotation on a public API."
correctionMessage: "Try adding a type annotation."
state:
@@ -11749,6 +12114,7 @@
With types, all of this is clarified.
type_init_formals:
+ comment: No parameters.
problemMessage: "Don't needlessly type annotate initializing formals."
correctionMessage: "Try removing the type."
state:
@@ -11860,6 +12226,7 @@
}
```
type_literal_in_constant_pattern:
+ comment: No parameters.
problemMessage: "Use 'TypeName _' instead of a type literal."
correctionMessage: "Replace with 'TypeName _'."
state:
@@ -11961,6 +12328,7 @@
}
```
unawaited_futures:
+ comment: No parameters.
problemMessage: "Missing an 'await' for the 'Future' computed by this expression."
correctionMessage: "Try adding an 'await' or wrapping the expression with 'unawaited'."
state:
@@ -12050,6 +12418,7 @@
}
```
unintended_html_in_doc_comment:
+ comment: No parameters.
problemMessage: "Angle brackets will be interpreted as HTML."
correctionMessage: "Try using backticks around the content with angle brackets, or try replacing `<` with `<` and `>` with `>`."
state:
@@ -12168,6 +12537,7 @@
/// <https://example.com/example>
```
unnecessary_async:
+ comment: No parameters.
problemMessage: "Don't make a function 'async' if it doesn't use 'await'."
correctionMessage: "Try removing the 'async' modifier."
state:
@@ -12197,6 +12567,7 @@
}
```
unnecessary_await_in_return:
+ comment: No parameters.
problemMessage: "Unnecessary 'await'."
correctionMessage: "Try removing the 'await'."
state:
@@ -12226,6 +12597,7 @@
}
```
unnecessary_brace_in_string_interps:
+ comment: No parameters.
problemMessage: "Unnecessary braces in a string interpolation."
correctionMessage: "Try removing the braces."
state:
@@ -12275,6 +12647,7 @@
print("Hi, $name!");
```
unnecessary_breaks:
+ comment: No parameters.
problemMessage: "Unnecessary 'break' statement."
correctionMessage: "Try removing the 'break'."
state:
@@ -12330,6 +12703,7 @@
[language version](https://dart.dev/resources/language/evolution#language-versioning)
of 3.0 or greater. Explicit breaks are still required in Dart 2.19 and below.
unnecessary_const:
+ comment: No parameters.
problemMessage: "Unnecessary 'const' keyword."
correctionMessage: "Try removing the keyword."
state:
@@ -12382,6 +12756,7 @@
}
```
unnecessary_constructor_name:
+ comment: No parameters.
problemMessage: "Unnecessary '.new' constructor name."
correctionMessage: "Try removing the '.new'."
state:
@@ -12439,6 +12814,7 @@
var makeA = A.new;
```
unnecessary_final_with_type:
+ comment: No parameters.
sharedName: unnecessary_final
problemMessage: "Local variables should not be marked as 'final'."
correctionMessage: "Remove the 'final'."
@@ -12515,11 +12891,13 @@
}
```
unnecessary_final_without_type:
+ comment: No parameters.
sharedName: unnecessary_final
problemMessage: "Local variables should not be marked as 'final'."
correctionMessage: "Replace 'final' with 'var'."
hasPublishedDocs: false
unnecessary_getters_setters:
+ comment: No parameters.
problemMessage: "Unnecessary use of getter and setter to wrap a field."
correctionMessage: "Try removing the getter and setter and renaming the field."
state:
@@ -12590,6 +12968,9 @@
}
```
unnecessary_ignore:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unnecessary_ignore
problemMessage: "The diagnostic '{0}' isn't produced at this location so it doesn't need to be ignored."
correctionMessage: "Try removing the ignore comment."
@@ -12623,21 +13004,31 @@
deprecatedDetails: |-
**DON'T** specify an ignore for a diagnostic that is not produced.
unnecessary_ignore_file:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unnecessary_ignore
problemMessage: "The diagnostic '{0}' isn't produced in this file so it doesn't need to be ignored."
correctionMessage: "Try removing the ignore comment."
hasPublishedDocs: false
unnecessary_ignore_name:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unnecessary_ignore
problemMessage: "The diagnostic '{0}' isn't produced at this location so it doesn't need to be ignored."
correctionMessage: "Try removing the name from the list."
hasPublishedDocs: false
unnecessary_ignore_name_file:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unnecessary_ignore
problemMessage: "The diagnostic '{0}' isn't produced in this file so it doesn't need to be ignored."
correctionMessage: "Try removing the name from the list."
hasPublishedDocs: false
unnecessary_lambdas:
+ comment: No parameters.
problemMessage: "Closure should be a tearoff."
correctionMessage: "Try using a tearoff rather than a closure."
state:
@@ -12689,6 +13080,7 @@
names.forEach(print);
```
unnecessary_late:
+ comment: No parameters.
problemMessage: "Unnecessary 'late' modifier."
correctionMessage: "Try removing the 'late'."
state:
@@ -12754,6 +13146,7 @@
}
```
unnecessary_library_directive:
+ comment: No parameters.
problemMessage: "Library directives without comments or annotations should be avoided."
correctionMessage: "Try deleting the library directive."
state:
@@ -12783,6 +13176,7 @@
NOTE: Due to limitations with this lint, libraries with parts will not be
flagged for unnecessary library directives.
unnecessary_library_name:
+ comment: No parameters.
problemMessage: "Library names are not necessary."
correctionMessage: "Remove the library name."
state:
@@ -12855,6 +13249,7 @@
part "apart.dart"; // contains: `part of "good_library.dart";`
```
unnecessary_new:
+ comment: No parameters.
problemMessage: "Unnecessary 'new' keyword."
correctionMessage: "Try removing the 'new' keyword."
state:
@@ -12902,6 +13297,7 @@
}
```
unnecessary_null_aware_assignments:
+ comment: No parameters.
problemMessage: "Unnecessary assignment of 'null'."
correctionMessage: "Try removing the assignment."
state:
@@ -12961,6 +13357,7 @@
x ??= 1;
```
unnecessary_null_aware_operator_on_extension_on_nullable:
+ comment: No parameters.
problemMessage: "Unnecessary use of a null-aware operator to invoke an extension method on a nullable type."
correctionMessage: "Try removing the '?'."
state:
@@ -13020,6 +13417,7 @@
f(int? i) => i.m();
```
unnecessary_null_checks:
+ comment: No parameters.
problemMessage: "Unnecessary use of a null check ('!')."
correctionMessage: "Try removing the null check."
state:
@@ -13074,6 +13472,7 @@
}
```
unnecessary_null_in_if_null_operators:
+ comment: No parameters.
problemMessage: "Unnecessary use of '??' with 'null'."
correctionMessage: "Try removing the '??' operator and the 'null' operand."
state:
@@ -13127,6 +13526,7 @@
var x = a ?? 1;
```
unnecessary_nullable_for_final_variable_declarations:
+ comment: No parameters.
problemMessage: "Type could be non-nullable."
correctionMessage: "Try changing the type to be non-nullable."
state:
@@ -13169,6 +13569,7 @@
final int i = 1;
```
unnecessary_overrides:
+ comment: No parameters.
problemMessage: "Unnecessary override."
correctionMessage: "Try adding behavior in the overriding member or removing the override."
state:
@@ -13277,6 +13678,7 @@
`noSuchMethod` is a special method and is not checked by this rule.
unnecessary_parenthesis:
+ comment: No parameters.
problemMessage: "Unnecessary use of parentheses."
correctionMessage: "Try removing the parentheses."
state:
@@ -13334,6 +13736,7 @@
grouping defined by precedence. For example, the expression
`(a && b) || c && d`.
unnecessary_raw_strings:
+ comment: No parameters.
problemMessage: "Unnecessary use of a raw string."
correctionMessage: "Try using a normal string."
state:
@@ -13378,6 +13781,7 @@
var s3 = r'\a';
```
unnecessary_statements:
+ comment: No parameters.
problemMessage: "Unnecessary statement."
correctionMessage: "Try completing the statement or breaking it up."
state:
@@ -13460,6 +13864,7 @@
return myvar;
```
unnecessary_string_escapes:
+ comment: No parameters.
problemMessage: "Unnecessary escape in string literal."
correctionMessage: "Remove the '\\' escape."
state:
@@ -13503,6 +13908,7 @@
"this string contains 2 'single quotes' ";
```
unnecessary_string_interpolations:
+ comment: No parameters.
problemMessage: "Unnecessary use of string interpolation."
correctionMessage: "Try replacing the string literal with the variable name."
state:
@@ -13548,6 +13954,7 @@
String o = message;
```
unnecessary_this:
+ comment: No parameters.
problemMessage: "Unnecessary 'this.' qualifier."
correctionMessage: "Try removing 'this.'."
state:
@@ -13619,6 +14026,7 @@
}
```
unnecessary_to_list_in_spreads:
+ comment: No parameters.
problemMessage: "Unnecessary use of 'toList' in a spread."
correctionMessage: "Try removing the invocation of 'toList'."
state:
@@ -13675,6 +14083,7 @@
]
```
unnecessary_unawaited:
+ comment: No parameters.
problemMessage: "Unnecessary use of 'unawaited'."
correctionMessage: "Try removing the use of 'unawaited', as the unawaited element is annotated with '@awaitNotRequired'."
state:
@@ -13746,6 +14155,7 @@
}
```
unnecessary_underscores:
+ comment: No parameters.
problemMessage: "Unnecessary use of multiple underscores."
correctionMessage: "Try using '_'."
state:
@@ -13789,6 +14199,9 @@
unreachable_from_main:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Unreachable member '{0}' in an executable library."
correctionMessage: "Try referencing the member or removing it."
state:
@@ -13821,6 +14234,10 @@
void f() {}
```
unrelated_type_equality_checks_in_expression:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: unrelated_type_equality_checks
problemMessage: "The type of the right operand ('{0}') isn't a subtype or a supertype of the left operand ('{1}')."
correctionMessage: "Try changing one or both of the operands."
@@ -13983,11 +14400,18 @@
class DerivedClass2 extends ClassBase with Mixin {}
```
unrelated_type_equality_checks_in_pattern:
+ comment: |-
+ Parameters:
+ 0: undocumented
+ 1: undocumented
sharedName: unrelated_type_equality_checks
problemMessage: "The type of the operand ('{0}') isn't a subtype or a supertype of the value being matched ('{1}')."
correctionMessage: "Try changing one or both of the operands."
hasPublishedDocs: true
unsafe_html_attribute:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unsafe_html
problemMessage: "Assigning to the attribute '{0}' is unsafe."
correctionMessage: "Try finding a different way to implement the page."
@@ -14020,16 +14444,23 @@
This rule has been removed.
unsafe_html_constructor:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unsafe_html
problemMessage: "Invoking the constructor '{0}' is unsafe."
correctionMessage: "Try finding a different way to implement the page."
hasPublishedDocs: false
unsafe_html_method:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: unsafe_html
problemMessage: "Invoking the method '{0}' is unsafe."
correctionMessage: "Try finding a different way to implement the page."
hasPublishedDocs: false
unsafe_variance:
+ comment: No parameters.
problemMessage: "This type is unsafe: a type parameter occurs in a non-covariant position."
correctionMessage: "Try using a more general type that doesn't contain any type parameters in such a position."
state:
@@ -14215,6 +14646,7 @@
}
```
use_build_context_synchronously_async_use:
+ comment: No parameters.
sharedName: use_build_context_synchronously
problemMessage: "Don't use 'BuildContext's across async gaps."
correctionMessage: "Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check."
@@ -14330,11 +14762,13 @@
}
```
use_build_context_synchronously_wrong_mounted:
+ comment: No parameters.
sharedName: use_build_context_synchronously
problemMessage: "Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check."
correctionMessage: "Guard a 'State.context' use with a 'mounted' check on the State, and other BuildContext use with a 'mounted' check on the BuildContext."
hasPublishedDocs: true
use_colored_box:
+ comment: No parameters.
problemMessage: "Use a 'ColoredBox' rather than a 'Container' with only a 'Color'."
correctionMessage: "Try replacing the 'Container' with a 'ColoredBox'."
state:
@@ -14403,6 +14837,7 @@
}
```
use_decorated_box:
+ comment: No parameters.
problemMessage: "Use 'DecoratedBox' rather than a 'Container' with only a 'Decoration'."
correctionMessage: "Try replacing the 'Container' with a 'DecoratedBox'."
state:
@@ -14491,6 +14926,7 @@
}
```
use_enums:
+ comment: No parameters.
problemMessage: "Class should be an enum."
correctionMessage: "Try using an enum rather than a class."
state:
@@ -14544,6 +14980,7 @@
}
```
use_full_hex_values_for_flutter_colors:
+ comment: No parameters.
problemMessage: "Instances of 'Color' should be created using an 8-digit hexadecimal integer (such as '0xFFFFFFFF')."
state:
stable: "2.2"
@@ -14592,6 +15029,9 @@
Color(0x00000001);
```
use_function_type_syntax_for_parameters:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use the generic function type syntax to declare the parameter '{0}'."
correctionMessage: "Try using the generic function type syntax."
state:
@@ -14633,6 +15073,7 @@
Iterable<T> where(bool Function(T) predicate) {}
```
use_if_null_to_convert_nulls_to_bools:
+ comment: No parameters.
problemMessage: "Use an if-null operator to convert a 'null' to a 'bool'."
correctionMessage: "Try using an if-null operator."
state:
@@ -14690,6 +15131,9 @@
}
```
use_is_even_rather_than_modulo:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use '{0}' rather than '% 2'."
correctionMessage: "Try using '{0}'."
state:
@@ -14711,6 +15155,7 @@
bool isOdd = 13.isOdd;
```
use_key_in_widget_constructors:
+ comment: No parameters.
problemMessage: "Constructors for public widgets should have a named 'key' parameter."
correctionMessage: "Try adding a named parameter to the constructor."
state:
@@ -14777,6 +15222,7 @@
}
```
use_late_for_private_fields_and_variables:
+ comment: No parameters.
problemMessage: "Use 'late' for private members with a non-nullable type."
correctionMessage: "Try making adding the modifier 'late'."
state:
@@ -14846,6 +15292,9 @@
}
```
use_named_constants:
+ comment: |-
+ Parameters:
+ 0: undocumented
problemMessage: "Use the constant '{0}' rather than a constructor returning the same object."
correctionMessage: "Try using '{0}'."
state:
@@ -14889,6 +15338,7 @@
Duration.zero;
```
use_null_aware_elements:
+ comment: No parameters.
problemMessage: "Use the null-aware marker '?' rather than a null check via an 'if'."
correctionMessage: "Try using '?'."
state:
@@ -14931,6 +15381,7 @@
f(String? key) => {?key: "value"};
```
use_raw_strings:
+ comment: No parameters.
problemMessage: "Use a raw string to avoid using escapes."
correctionMessage: "Try making the string a raw string and removing the escapes."
state:
@@ -14974,6 +15425,7 @@
var s = r'A string with only \ and $';
```
use_rethrow_when_possible:
+ comment: No parameters.
problemMessage: "Use 'rethrow' to rethrow a caught exception."
correctionMessage: "Try replacing the 'throw' with a 'rethrow'."
state:
@@ -15042,6 +15494,7 @@
}
```
use_setters_to_change_properties:
+ comment: No parameters.
problemMessage: "The method is used to change a property."
correctionMessage: "Try converting the method to a setter."
state:
@@ -15094,6 +15547,7 @@
button.visible = false;
```
use_string_buffers:
+ comment: No parameters.
problemMessage: "Use a string buffer rather than '+' to compose strings."
correctionMessage: "Try writing the parts of a string to a string buffer."
state:
@@ -15163,6 +15617,7 @@
}
```
use_string_in_part_of_directives:
+ comment: No parameters.
problemMessage: "The part-of directive uses a library name."
correctionMessage: "Try converting the directive to use the URI of the library."
state:
@@ -15218,6 +15673,9 @@
part of '../../my_library.dart';
```
use_super_parameters_multiple:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: use_super_parameters
problemMessage: "Parameters '{0}' could be super parameters."
correctionMessage: "Trying converting '{0}' to super parameters."
@@ -15287,11 +15745,15 @@
}
```
use_super_parameters_single:
+ comment: |-
+ Parameters:
+ 0: undocumented
sharedName: use_super_parameters
problemMessage: "Parameter '{0}' could be a super parameter."
correctionMessage: "Trying converting '{0}' to a super parameter."
hasPublishedDocs: true
use_test_throws_matchers:
+ comment: No parameters.
problemMessage: "Use the 'throwsA' matcher instead of using 'fail' when there is no exception thrown."
correctionMessage: "Try removing the try-catch and using 'throwsA' to expect an exception."
state:
@@ -15336,6 +15798,7 @@
);
```
use_to_and_as_if_applicable:
+ comment: No parameters.
problemMessage: "Start the name of the method with 'to' or 'as'."
correctionMessage: "Try renaming the method to use either 'to' or 'as'."
state:
@@ -15378,6 +15841,7 @@
}
```
use_truncating_division:
+ comment: No parameters.
problemMessage: "Use truncating division."
correctionMessage: "Try using truncating division, '~/', instead of regular division ('/') followed by 'toInt()'."
state:
@@ -15427,6 +15891,7 @@
var x = 2 ~/ 3;
```
valid_regexps:
+ comment: No parameters.
problemMessage: "Invalid regular expression syntax."
correctionMessage: "Try correcting the regular expression."
state:
@@ -15476,6 +15941,7 @@
print(RegExp(r'\(').hasMatch('foo()'));
```
void_checks:
+ comment: No parameters.
problemMessage: "Assignment to a variable of type 'void'."
correctionMessage: "Try removing the assignment or changing the type of the variable."
state:
diff --git a/tools/VERSION b/tools/VERSION
index 02734e4..0066c6e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 3
MINOR 10
PATCH 0
-PRERELEASE 84
+PRERELEASE 85
PRERELEASE_PATCH 0