camel-case-extensions
Same as camel_case_extensions in Dart lints
- Group
- Style
- Path
lint/style/camel-case-extensions- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 195 of 512
Flags named extensions whose name is not UpperCamelCase.
Extensions are types and should follow the same naming convention as classes
and enums so that tooling and readers treat them consistently. Leading
underscores are ignored for the check; the remainder must be one or more
words, each starting with an uppercase letter or $. Unnamed extensions have
no identifier to check and are skipped.
Invalid
// Named extensions must be UpperCamelCase.
extension my_ext on int {}
extension foo_bar on String {}
extension lowercase on double {}
extension mixedCase on num {}
extension a on bool {}
extension _lower on List {} extension my_ext on int {} extension foo_bar on String {} extension lowercase on double {} extension mixedCase on num {} extension a on bool {} extension _lower on List {}Valid
// UpperCamelCase (or unnamed) extensions.
extension IntX on int {}
extension StringUtils on String {}
extension MyExtension on double {}
extension _Private on num {}
extension HTTPExt on bool {}
extension on List {}Configure camel-case-extensions
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"camel-case-extensions": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/camel-case-extensions: <reason>More style rules
- camel-case-types
camel_case_typesrecommendedFlags type names that are not
UpperCamelCase. - cast-nullable-to-non-nullable
cast_nullable_to_non_nullableFlags
e as Tcasts of a nullable value to a non-nullable type. - class-members-ordering
class_members_orderingFlags class members declared out of a canonical order.
- combinators-ordering
combinators_orderingFlags
show/hidecombinators whose names are not sorted alphabetically. - conditional-uri-does-not-exist
conditional_uri_does_not_existrecommendedRequire the targets of conditional import and export URIs to exist.
- constant-identifier-names
constant_identifier_namesrecommendedFlags constant identifiers that are not lowerCamelCase.
- curly-braces-in-flow-control-structures
curly_braces_in_flow_control_structuresrecommendedRequires curly braces around the bodies of flow-control statements.
- dangling-library-doc-comments
dangling_library_doc_commentsrecommendedAttach library documentation to an explicit
librarydirective.