Skip to content

Conversation

@echo094
Copy link
Contributor

@echo094 echo094 commented Jan 25, 2025

When a block is the only block in its container, this nested block can be removed safely:

let x1;
function fun1(f) {
    {
        let x1 = f;
        return x1;
    }
}

@coderaiser
Copy link
Owner

coderaiser commented Jan 25, 2025

Nice! Please run npm run fix:lint in the directory of a plugin to fix linting-related issues.

@echo094 echo094 changed the title remove-nested-blocks and remove-unreachable-code feature: @putout/plugin-remove-nested-blocks: case when it is the only block Jan 25, 2025
…y block

Signed-off-by: echo094 <20028238+echo094@users.noreply.github.com>
@echo094 echo094 marked this pull request as ready for review January 25, 2025 19:31
@coderaiser coderaiser merged commit e109fd2 into coderaiser:master Jan 25, 2025
8 checks passed
@coderaiser
Copy link
Owner

Thank you!

@echo094 echo094 deleted the unreachable_and_nested branch February 2, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants