You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4
+
5
+
## Type of change
6
+
7
+
Please delete options that are not relevant.
8
+
9
+
-[ ] Bug fix (non-breaking change which fixes an issue)
10
+
-[ ] New feature (non-breaking change which adds functionality)
11
+
-[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12
+
-[ ] This change requires a documentation update
13
+
14
+
# Limitations:
15
+
16
+
Please describe limitations of this PR
17
+
18
+
# Testing:
19
+
20
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
21
+
22
+
-[ ] Test A
23
+
-[ ] Test B
24
+
25
+
# Checklist:
26
+
27
+
-[ ] My code follows the style guidelines of this project
28
+
-[ ] My code has been formatted with `npm run format` and passes the checks in `npm run check`
29
+
-[ ] I have performed a self-review of my own code
30
+
-[ ] I have commented my code, particularly in hard-to-understand areas
31
+
-[ ] I have made corresponding changes to the documentation
32
+
-[ ] My changes generate no new warnings
33
+
-[ ] Any dependent changes have been merged and published in downstream modules
Copy file name to clipboardExpand all lines: CODING_STANDARDS.md
+10-23Lines changed: 10 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,24 @@
2
2
3
3
## Coding guidelines for TypeScript
4
4
5
-
- The following standards are inspired from
6
-
[Coding guidelines for TypeScript](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines)
7
-
(which you should follow when something is not specified in this document,
8
-
although any pre-existing practices in a file being edited trump either
9
-
style guide).
5
+
- The following standards are inspired from [Coding guidelines for TypeScript](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) (which you should follow when something is not specified in this document, although any pre-existing practices in a file being edited trump either style guide).
10
6
11
7
### Names
12
8
13
9
- Use `PascalCase` for type names.
14
-
- Use `I` as a prefix for interface names only when an interface is
15
-
implemented by a class.
10
+
- Use `I` as a prefix for interface names only when an interface is implemented by a class.
16
11
- Use `PascalCase` for enum values.
17
12
- Use `camelCase` for function names.
18
13
- Use `camelCase` for property names and local variables.
19
-
- Do not use `_` as a prefix for private properties (unless used as backing
20
-
properties).
14
+
- Do not use `_` as a prefix for private properties (unless used as backing properties).
21
15
- Use whole words in names when possible.
22
16
23
17
### Types
24
18
25
-
- Do not export types/functions unless you need to share it across multiple
26
-
components.
19
+
- Do not export types/functions unless you need to share it across multiple components.
27
20
- Do not introduce new types/values to the global namespace.
28
-
- Shared types should be defined in `types.ts`. Within a file, type
29
-
definitions should come first.
21
+
- Shared types should be defined in `types.ts`.
22
+
Within a file, type definitions should come first.
30
23
31
24
### null and undefined
32
25
@@ -44,21 +37,16 @@ Use single quotes for strings.
44
37
### Imports
45
38
46
39
- Use ES6 module imports.
47
-
- Do not use bare `import *`; all imports should either explicitly pull in an
48
-
object or import an entire module, otherwise you're implicitly polluting the
49
-
global namespace and making it difficult to figure out from code examination
50
-
where a name originates from.
40
+
- Do not use bare `import *`; all imports should either explicitly pull in an object or import an entire module, otherwise you're implicitly polluting the global namespace and making it difficult to figure out from code examination where a name originates from.
51
41
52
42
### Style
53
43
54
44
- Use `prettier` to format `TypeScript` and `JavaScript` code.
55
45
- Use arrow functions over anonymous function expressions.
56
-
- Always surround loop and conditional bodies with curly braces. Statements on
57
-
the same line are allowed to omit braces.
46
+
- Always surround loop and conditional bodies with curly braces. Statements on the same line are allowed to omit braces.
58
47
- Open curly braces always go on the same line as whatever necessitates them.
59
48
- Parenthesized constructs should have no surrounding whitespace.
60
-
- A single space follows commas, colons, and semicolons in those constructs.
61
-
For example:
49
+
- A single space follows commas, colons, and semicolons in those constructs. For example:
62
50
63
51
-`for (var i = 0, n = str.length; i < 10; i++) { }`
0 commit comments