Skip to content

Commit 2cff856

Browse files
committed
Add import new line breaks with trailing comma
1 parent f73a57b commit 2cff856

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ This is the TypeScript style guide that we use internally at Contorion! It is *s
4646
0. [=== and !== Operators](#===-and-!==-Operators)
4747
0. [Eval](#eval)
4848
0. [TSLint](#tslint)
49+
0. [Max Line Length](#max-line-length)
50+
0. [Trailing Comma](#trailing-comma)
51+
0. [Import](#import)
4952
0. [License](#license)
5053

5154
## Introduction
@@ -1048,7 +1051,24 @@ Blank lines improve code readability by allowing the developer to logically grou
10481051
'Chris',
10491052
'Berlin',
10501053
];
1051-
```
1054+
```
1055+
1056+
### Import
1057+
1058+
- When making an import, watch out for the max line length
1059+
- To assure more readability, we list the imports on new lines when there are >= 3
1060+
1061+
```typescript
1062+
// bad
1063+
import { ITouchExtended, NavigationService, navigationService } from '../services/navigation.service';
1064+
1065+
// good
1066+
import {
1067+
ITouchExtended,
1068+
NavigationService,
1069+
navigationService,
1070+
} from '../services/navigation.service';
1071+
```
10521072

10531073
**[top](#table-of-contents)**
10541074

0 commit comments

Comments
 (0)