Best Practices
Naming Conventions
Use Descriptive IDs
// ✅ Good - Descriptive and namespaced
{ id: "my-expansion-api-key", label: "API Key" }
{ id: "my-expansion-enable-sync", label: "Enable Sync" }
{ id: "my-expansion-max-items", label: "Maximum Items" }
// ❌ Bad - Generic and prone to conflicts
{ id: "key", label: "API Key" }
{ id: "enabled", label: "Enable Sync" }
{ id: "max", label: "Maximum Items" }Follow Naming Patterns
// ✅ Good - Consistent pattern
"expansion-api-key"
"expansion-api-endpoint"
"expansion-api-timeout"
// ❌ Bad - Inconsistent
"expansionAPIKey"
"api_endpoint"
"timeout-expansion"Default Values
Always Provide Defaults
Choose Sensible Defaults
User Experience
Add Helpful Descriptions
Use Appropriate Element Types
Add Validation
Organization
Use Categories
Use Separators
Order Logically
Error Handling
Provide Fallback Values
Handle Async Errors
Performance
Cache Settings
Use Event Listeners
Security
Don't Expose Sensitive Data
Validate Input
Documentation
Add Placeholders
Use Hints
Document Complex Settings
Testing
Test Default Values
Test Edge Cases
Common Mistakes to Avoid
❌ Not Providing Defaults
❌ Hardcoding Values
❌ Ignoring Types
❌ Not Validating Input
Quick Checklist
Next Steps
Last updated