camel-case-types
Same as camel_case_types in Dart lints
- Group
- Style
- Path
lint/style/camel-case-types- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 196 of 512
Flags type names that are not UpperCamelCase.
Classes, mixins, enums, extension types, and type aliases are all types and
read most predictably when named in UpperCamelCase, matching the rest of the
Dart ecosystem. Leading underscores are ignored, then each word must begin
with an uppercase letter or $; a name that is entirely underscores is
treated as a wildcard and never flagged.
Invalid
// Type names must be UpperCamelCase.
class my_class {}
class Foo_Bar {}
enum my_enum { a, b }
mixin my_mixin {}
typedef my_callback = void Function();
extension type my_id(int i) {} class my_class {} class Foo_Bar {} enum my_enum { a, b } mixin my_mixin {} typedef my_callback = void Function(); extension type my_id(int i) {}Valid
// UpperCamelCase type names.
class MyClass {}
class HTTPRequest {}
class _Private {}
enum Color { red, green, blue }
mixin Flying {}
typedef IntList = List<int>;
extension type UserId(int i) {}Configure camel-case-types
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"camel-case-types": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/camel-case-types: <reason>More style rules
- 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. - deprecated-consistency
deprecated_consistencyrecommendedFlags deprecations that are not carried through to related declarations.