rspec/rules/S101/dart/rule.adoc

52 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-07-11 21:46:42 +02:00
== 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).
2024-07-11 21:46:42 +02:00
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
2024-07-11 21:46:42 +02:00
----
==== 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[]