-
Notifications
You must be signed in to change notification settings - Fork 264
Code Style
Eugenio Romano edited this page Oct 14, 2017
·
16 revisions
The code style is defined in the tslint.json and .editorconfig files.
- Do name events without the prefix on.
- Do name event handler methods with the prefix on followed by the event name
- Do name events in camelcase.
- All event names should be verbs and use the present tense. For example, cancel instead of canceled
- Avoid aliasing inputs and outputs
- Do name in camelcase.
- leave one whitespace character inside of the import statements' curly braces ("ES6 import/export braces" rule for IntelliJ IDEA)
- leave one whitespace character after type reference colon ':' ("After type reference colon ':'" rule for IntelliJ IDEA)
- All the Directive has to end with the suffix .directive
- All the Component has to end with the suffix .component
- All the Service has to end with the suffix .service
- ALFRESCO|ACTIVITI|ADF prefix for file names are not allowed
- All the Directive class name has to end with the suffix Directive
- All the Component class name has to end with the suffix Component
- All the Service class name has to end with the suffix Service
- ALFRESCO|ACTIVITI|ADF prefixes are not allowed
- CSS files are deprecated in the project use only scss
- All the style class has to start with ADF- prefix
- All the keys has to be uppercase and separated with underscore example : CAPITALIZED_WITH_UNDERSCORES
- Not use concatenated keys
- Extract templates and styles to their own files
- Class selector in all the test is not suggested. Element ID is preferred
More other styling rules to be cosidered as good to use are referenced here: Angular style guide
May you want to use our yeoman generator to create a new component Component generator