Skip to content

Wrap lexical declarations inside switch cases#305

Merged
DiegoRBaquero merged 4 commits intowebtorrent:masterfrom
justinkalland:fix-no-case-declarations
Dec 20, 2018
Merged

Wrap lexical declarations inside switch cases#305
DiegoRBaquero merged 4 commits intowebtorrent:masterfrom
justinkalland:fix-no-case-declarations

Conversation

@justinkalland
Copy link
Copy Markdown
Contributor

In order to comply with the new proposed standard rule no-case-declaration:

standard/eslint-config-standard#137

Copy link
Copy Markdown
Member

@DiegoRBaquero DiegoRBaquero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer using blocks with brackets as shown in the correct example (https://eslint.org/docs/rules/no-case-declarations). Else now the variables are even shared on an upper scope, defeating the purpose of the rule.

@justinkalland
Copy link
Copy Markdown
Contributor Author

Agreed @DiegoRBaquero, I have changed it.

@justinkalland justinkalland changed the title Remove declarations from inside switch statements Wrap lexical declarations inside switch cases Dec 20, 2018
@DiegoRBaquero DiegoRBaquero merged commit 19a363d into webtorrent:master Dec 20, 2018
@justinkalland
Copy link
Copy Markdown
Contributor Author

❤️ Thanks for the fast review.

@justinkalland justinkalland deleted the fix-no-case-declarations branch December 20, 2018 20:19
@DiegoRBaquero
Copy link
Copy Markdown
Member

Thank you for the PR ! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants