File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ Please:
54
54
* Use ` def ` for read-only properties unless there is a compelling reason it should be a ` val `
55
55
(i.e., the spec definitively states it is constant)
56
56
* Use ` Double ` for integer-values that can fall outside the range of ` Int `
57
+ * Prefer adding overloads instead of using union ` | ` types for method and constructor parameters. For example:
58
+ ``` diff
59
+ - def createElement(tagName: String, options: String | ElementCreationOptions = js.native): Element = js.native
60
+ + def createElement(tagName: String): Element = js.native
61
+ + def createElement(tagName: String, options: String): Element = js.native
62
+ + def createElement(tagName: String, options: ElementCreationOptions): Element = js.native
63
+ ```
57
64
* Add scaladocs via copy-paste from MDN
58
65
59
66
You can’t perform that action at this time.
0 commit comments