Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 5143689

Browse files
committedFeb 21, 2018
feat: add curly for 16.1
#31
1 parent 44e6545 commit 5143689

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

Diff for: ‎sample/index.ts

+22
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,25 @@ function rule15_7_good(a: Object, b: Object, c: Object) {
7777
const bar = !!c;
7878
const baz = !c;
7979
}
80+
81+
function rule16_1(test: boolean) {
82+
// bad
83+
if (test)
84+
return false;
85+
86+
// good
87+
if (test) return false;
88+
89+
// good
90+
if (test) {
91+
return false;
92+
}
93+
94+
// bad
95+
function foo() { return false; }
96+
97+
// good
98+
function bar() {
99+
return false;
100+
}
101+
}

Diff for: ‎tslint.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = {
5252
'allow-string',
5353
'allow-mix',
5454
],
55+
curly: [true, 'ignore-same-line'], // 16.1
5556
'brace-style': [
5657
true,
5758
'1tbs',

0 commit comments

Comments
 (0)
This repository has been archived.