Skip to main content

Code reviews rule: Inconsistent naming Aura controller properties

Written by David Martin
Updated this week

Inconsistent naming Aura controller properties

Why is this an issue?

Naming conventions help drive consistency across the application, making source code easier to read and understand.

Examples

Example of incorrect code:

({
$doSomething : function(component, event, helper) {
// ...
},
})

Example of correct code:

({
doSomething : function(component, event, helper) {
// ...
},
})

How can I fix violations?

Rename the property to match the configured naming pattern. By default, property names must contain only letters, digits, hyphens, and underscores.

Configuration options

You can configure a custom pattern that property names must match. You can also configure a hint to display in violation messages.

Resources

Did this answer your question?