@@ -23,6 +23,7 @@ export default ts.config(
23
23
} ,
24
24
rules : {
25
25
'anti-trojan-source/no-bidi' : 'error' ,
26
+ curly : [ 'error' , 'multi-line' , 'consistent' ] ,
26
27
'no-constant-condition' : [ 'warn' , { checkLoops : false } ] ,
27
28
'no-constant-binary-expression' : 'error' ,
28
29
'no-caller' : 'error' ,
@@ -44,6 +45,31 @@ export default ts.config(
44
45
'no-mixed-spaces-and-tabs' : 'off' ,
45
46
'no-restricted-globals' : [ 'error' , 'process' ] ,
46
47
'no-restricted-imports' : 'off' ,
48
+ 'no-restricted-syntax' : [
49
+ 'error' ,
50
+ {
51
+ selector :
52
+ 'IfStatement:not(:has(BlockStatement)):not(:has(ReturnStatement)):not(:has(BreakStatement)):not(:has(ContinueStatement)):not(:has(YieldExpression)):not(:has(ThrowStatement))' ,
53
+ message :
54
+ 'Single-line if statements are only allowed for control flow (return, break, continue, throw, yield).' ,
55
+ } ,
56
+ {
57
+ selector : 'WhileStatement:not(:has(BlockStatement))' ,
58
+ message : 'Single-line while statements are not allowed.' ,
59
+ } ,
60
+ {
61
+ selector : 'ForStatement:not(:has(BlockStatement))' ,
62
+ message : 'Single-line for statements are not allowed.' ,
63
+ } ,
64
+ {
65
+ selector : 'ForInStatement:not(:has(BlockStatement))' ,
66
+ message : 'Single-line for-in statements are not allowed.' ,
67
+ } ,
68
+ {
69
+ selector : 'ForOfStatement:not(:has(BlockStatement))' ,
70
+ message : 'Single-line for-of statements are not allowed.' ,
71
+ } ,
72
+ ] ,
47
73
'no-return-assign' : 'error' ,
48
74
'no-return-await' : 'warn' ,
49
75
'no-self-compare' : 'error' ,
0 commit comments