@@ -23,6 +23,7 @@ export default ts.config(
2323 } ,
2424 rules : {
2525 'anti-trojan-source/no-bidi' : 'error' ,
26+ curly : [ 'error' , 'multi-line' , 'consistent' ] ,
2627 'no-constant-condition' : [ 'warn' , { checkLoops : false } ] ,
2728 'no-constant-binary-expression' : 'error' ,
2829 'no-caller' : 'error' ,
@@ -44,6 +45,31 @@ export default ts.config(
4445 'no-mixed-spaces-and-tabs' : 'off' ,
4546 'no-restricted-globals' : [ 'error' , 'process' ] ,
4647 '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+ ] ,
4773 'no-return-assign' : 'error' ,
4874 'no-return-await' : 'warn' ,
4975 'no-self-compare' : 'error' ,
0 commit comments