Enforce wrapping of conditional statements and loop statements in curly braces. This rule only checks .ets files.
export function test(a: number, b: number) {
if (a > b) {
console.info('doSomething');
} else if (a === b) {
console.info('doSomething');
} else {
console.info('doSomething');
}
while (a > b) {
a--;
console.info('doSomething');
}
console.info('doSomething');
} export function test(a: number, b: number) {
if (a > b)
// Expected { after 'if' condition.
console.info('doSomething');
else if (a === b)
// Expected { after 'if' condition.
console.info('doSomething');
else
// Expected { after 'else'.
console.info('doSomething');
console.info('doSomething');
} "plugin:@hw-stylistic/recommended" "plugin:@hw-stylistic/all"
For details about how to configure Code Linter check rules, see Code Linter.