@@ -68,14 +68,22 @@ high user value for price we pay both in maintenance, complexity, and payload si
68
68
leave it out.
69
69
70
70
This applies especially so to providing two different APIs to accomplish the same thing. Always
71
- prefer sticking to a _ single_ API for accomplishing something.
71
+ prefer sticking to a _ single_ API for accomplishing something.
72
+
73
+ ### 100 column limit
74
+ All code and docs in the repo should be 100 columns or fewer. This applies to TypeScript, SCSS,
75
+ HTML, bash scripts, and markdown files.
72
76
73
77
### TypeScript
74
78
75
79
#### Typing
76
80
Avoid ` any ` where possible. If you find yourself using ` any ` , consider whether a generic may be
77
81
appropriate in your case.
78
82
83
+ For methods and properties that are part of a component's public API, all types must be explicitly
84
+ specified because our documentation tooling cannot currently infer types in places where TypeScript
85
+ can.
86
+
79
87
#### Fluent APIs
80
88
When creating a fluent or builder-pattern style API, use the ` this ` return type for methods:
81
89
```
@@ -90,12 +98,16 @@ class ConfigBuilder {
90
98
#### Access modifiers
91
99
* Omit the ` public ` keyword as it is the default behavior.
92
100
* Use ` private ` when appropriate and possible, prefixing the name with an underscore.
101
+ * Use ` protected ` when appropriate and possible with no prefix.
93
102
* Prefix * library-internal* properties and methods with an underscore without using the ` private `
94
103
keyword. This is necessary for anything that must be public (to be used by Angular), but should not
95
104
be part of the user-facing API. This typically applies to symbols used in template expressions,
96
105
` @ViewChildren ` / ` @ContentChildren ` properties, host bindings, and ` @Input ` / ` @Output ` properties
97
106
(when using an alias).
98
107
108
+ Additionally, the ` @docs-private ` JsDoc annotation can be used to hide any symbol from the public
109
+ API docs.
110
+
99
111
#### JsDoc comments
100
112
101
113
All public APIs must have user-facing comments. These are extracted and shown in the documation
0 commit comments