26 lines
520 B
Plaintext
26 lines
520 B
Plaintext
By convention, a file that exports only one class, function, or constant should be named for that class, function or constant. Anything else may confuse maintainers.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
// file path: myclass.js -- Noncompliant
|
|
class MyClass {
|
|
// ...
|
|
}
|
|
export default MyClass;
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
// file path: MyClass.js
|
|
class MyClass {
|
|
// ...
|
|
}
|
|
export default MyClass;
|
|
----
|
|
|
|
== Exceptions
|
|
|
|
Case, underscores ( ``++_++`` ) and dashes (``++-++``) are ignored from the name comparison.
|