rspec/rules/S101/dart/rule.adoc
2024-08-02 12:39:13 +03:00

52 lines
1.1 KiB
Plaintext

== Why is this an issue?
Shared naming conventions allow teams to collaborate efficiently. In Dart, the convention is that all type names should be in camel-case starting with a capital letter (aka Pascal case).
This rule raises an issue when a class name does not comply with this convention.
== How to fix it
=== Code examples
==== Noncompliant code example
[source,dart]
----
class My_Class { } // Noncompliant: contains a dash
class myClass { } // Noncompliant: starts with a lowercase
class myclass { } // Noncompliant: all in lowercase
----
==== Compliant solution
[source,dart]
----
class MyClass { }
----
== Resources
* Dart Docs - https://dart.dev/tools/linter-rules/camel_case_types[Dart Linter rule - camel_case_types]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* The type name '<typeName>' isn't an UpperCamelCase identifier.
=== Highlighting
The type name (without generic parameters, or representation type declaration).
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]