Having the component name in sync with the file name offers better stack traces and debuggability.
Note: The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
Example of incorrect code:
// foo.js
export default class extends LightningElement {}
// foo.js
export default class Bar extends LightningElement {}
Example of correct code:
// foo.js
export default class Foo extends LightningElement {}
// complexName.js
export default class ComplexName extends LightningElement {}