Redo the NeedBraces rule to require braces on if statements with else blocks.

This commit is contained in:
EliteMasterEric
2026-04-06 04:18:09 -06:00
committed by Hundrec
parent 17cfd2e2f8
commit 72d3d4546f
+10 -9
View File
@@ -476,15 +476,16 @@
"comment": "If enabled, mandates the use of braces on specific block types, unless they fit on a single line.",
"props": {
"allowSingleLineStatement": true,
"tokens": [
"FUNCTION",
"FOR",
"IF",
"ELSE_IF",
"WHILE",
"DO_WHILE",
"CATCH"
],
"tokens": ["FUNCTION", "FOR", "IF", "IF_WITH_ELSE", "ELSE"],
"severity": "INFO"
},
"type": "NeedBraces"
},
{
"comment": "If enabled, mandates the use of braces on specific block types, and prevent them from being placed on a single line.",
"props": {
"allowSingleLineStatement": false,
"tokens": ["IF_WITH_ELSE", "CATCH", "WHILE", "DO_WHILE", "ELSE_IF"],
"severity": "INFO"
},
"type": "NeedBraces"