Layout
🎨 Spacing e Indentation
Indentation
// bad - mixed tabs and spaces
function processUser(user) {
const name = user.name
const email = user.email // spaces instead of tabs
return { name, email }
}
// bad - inconsistent indentation
if (condition) {
doSomething()
doSomethingElse() // wrong indentation
}// good - consistent 2-space indentation
function processUser(user) {
const name = user.name
const email = user.email
return { name, email }
}
// good - consistent indentation in blocks
if (condition) {
doSomething()
doSomethingElse()
}Spacing Around Operators
Function Calls e Declarations
🔧 Code Organization
File Structure
Import Organization
Function Organization
📐 Line Length e Breaking
Line Length
Object e Array Breaking
Method Chaining
🗂️ Block Organization
Conditional Blocks
Function Blocks
📝 Comments e Spacing
Comment Spacing
JSDoc Spacing
🎯 Best Practices Summary
Formatting Rules
Organization Rules
Consistency Rules
Last updated