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, dots ( .
), underscores ( _
) and dashes (-
) are ignored from the name comparison. Postfixes in
filenames like .dev
in my.class.dev.js
are also ignored.