-
Notifications
You must be signed in to change notification settings - Fork 65
Code style guide for components authoring #1647
Comments
HTML component tags should be displayed as:
Note: Since an element can only have one structural directive, we place those on the same line as the tag name. Note: Thus rule should be followed even if there is only one argument unless that one argument is a structural directive |
Imports
Order of imports |
Class properties
|
Constructors:
Note: If a new parameter is added to an existing constructor (or public method), it must be added as Note: Thus rule should be followed even if there is only one argument |
Observables: Class properties that represent Observable values should be suffixed with
|
Events/Outputs: Events that have happened (and will never happen again) are named in the past tense, and are completed immediately after firing:
If the event is intended to be fired multiple times, the property name should be in present tense:
If the Observable property is a value (and not an event), the property name should be suffixed with
|
Hey @Blackbaud-SteveBrush I really appreciate you taking the ball to get some of these documented. Did you have any thoughts about the best way to provide feedback? I'm happy to leave in the form of comments to this issue, just wanted to sync up before doing so. |
Methods
|
Strings If the string is longer than the max line length:
Multi-line:
|
Code blocks:
GOOD:
|
Unsubscribing from observables
|
Notes from discussion with @Blackbaud-SteveBrush and @blackbaud-conorwright based on Conor's notes from his initial SKY UX contributions: Conor's initial feedback: All components are supposed to be using Notes from follow-up discussion: This bleeds into style guide. It’s more implementation than style, but Steve wants to finalize the style guide and have a section on implementation details as well, and then link to that from the contribution guidelines. For normal contributions, we don’t really look at the style for acceptance criteria. We just check the public API and handle style after the fact. |
Closing - moved to internal SKY team docs site. |
Alex moved it to: https://docs.blackbaud.com/skyux-team-docs/style |
We need to provide some documentation around code style so that we have a constitution (of sorts) we can point to during development.
This document should include:
Input
andOutput
properties should be named, handledimport
statements are writtenThe text was updated successfully, but these errors were encountered: