rspec/rules/S7067/dart/rule.adoc
github-actions[bot] 183f408fc5
Create rule S7067: Library prefixes should comply with naming conventions (#4237)
Co-authored-by: leveretka <leveretka@users.noreply.github.com>
2024-09-09 10:00:16 +02:00

48 lines
1.0 KiB
Plaintext

== Why is this an issue?
Shared naming conventions allow teams to collaborate efficiently. In Dart, the convention is that all library prefixes should use lowercase_with_underscores.
This rule raises an issue when a library prefix does not comply with this convention.
== How to fix it
=== Code examples
==== Noncompliant code example
[source,dart,diff-id=1,diff-type=noncompliant]
----
import 'dart:io' as IO;
import 'dart:math' as Math;
import 'dart:js_interop' as jsInterop;
----
==== Compliant solution
[source,dart,diff-id=1,diff-type=compliant]
----
import 'dart:io' as io;
import 'dart:math' as math;
import 'dart:js_interop' as js_interop;
----
== Resources
* Dart Docs - https://dart.dev/tools/linter-rules/library_prefixes[Dart Linter rule - library_prefixes]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* The prefix <prefix> isn't a lower_case_with_underscores identifier.
=== Highlighting
The prefix identifier.
endif::env-github,rspecator-view[]