# no-lone-block

Disallow nested blocks with no scoping effect

A standalone block without scoped declarations adds nesting without changing the lifetime or visibility of any value.
Instead, you SHOULD remove the redundant braces and keep its statements in the enclosing block.

- Category: style
- Level: warning
- Fix: none
- Scope: module

## Reported

```ds title="main.ds"
declare function work(): void;

function run(): void {
    {
        work();
    }
}
```

## Accepted

```ds title="main.ds"
declare function work(): void;

function run(): void {
    work();
}
```

## Prior art

- [ESLint · no-lone-blocks](https://eslint.org/docs/latest/rules/no-lone-blocks)

[language/linter/src/rules/style/no_lone_block.rs:6](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/no_lone_block.rs#L6)
