Skip to content

Commit e81d81a

Browse files
committed
address comments
1 parent 0b7ba0d commit e81d81a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

CODING_STANDARDS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,22 @@ high user value for price we pay both in maintenance, complexity, and payload si
6868
leave it out.
6969

7070
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.
7276

7377
### TypeScript
7478

7579
#### Typing
7680
Avoid `any` where possible. If you find yourself using `any`, consider whether a generic may be
7781
appropriate in your case.
7882

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+
7987
#### Fluent APIs
8088
When creating a fluent or builder-pattern style API, use the `this` return type for methods:
8189
```
@@ -90,12 +98,16 @@ class ConfigBuilder {
9098
#### Access modifiers
9199
* Omit the `public` keyword as it is the default behavior.
92100
* Use `private` when appropriate and possible, prefixing the name with an underscore.
101+
* Use `protected` when appropriate and possible with no prefix.
93102
* Prefix *library-internal* properties and methods with an underscore without using the `private`
94103
keyword. This is necessary for anything that must be public (to be used by Angular), but should not
95104
be part of the user-facing API. This typically applies to symbols used in template expressions,
96105
`@ViewChildren` / `@ContentChildren` properties, host bindings, and `@Input` / `@Output` properties
97106
(when using an alias).
98107

108+
Additionally, the `@docs-private` JsDoc annotation can be used to hide any symbol from the public
109+
API docs.
110+
99111
#### JsDoc comments
100112

101113
All public APIs must have user-facing comments. These are extracted and shown in the documation

0 commit comments

Comments
 (0)