Enforce spacing before blocks. This rule only checks .ets files.
Exceptions:
// code-linter.json5
{
"rules": {
"@hw-stylistic/space-before-blocks": "error"
}
} export function a() {
// doSomething
}
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Text('Hello World')
}
.width('100%')
}
.height('100%')
}
} // Missing space before opening brace.
export function a(){
// doSomething
}
@Entry
@Component
// Missing space before opening brace.
struct Index{
// Missing space before opening brace.
build(){
// Missing space before opening brace.
Row(){
// Missing space before opening brace.
Column(){
Text('Hello World')
}
.width('100%')
}
.height('100%')
}
} "plugin:@hw-stylistic/recommended" "plugin:@hw-stylistic/all"
For details about how to configure Code Linter check rules, see Code Linter.