Skip to content

Commit

Permalink
perf: add fast path to no-case-declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
ElianCordoba committed Jun 27, 2023
1 parent 9718a97 commit c1d8401
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rules/no-case-declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ module.exports = {

return {
SwitchCase(node) {
if (node.consequent.length === 0 || node.consequent[0].type === "BlockStatement") {
return;
}

for (let i = 0; i < node.consequent.length; i++) {
const statement = node.consequent[i];

Expand Down

0 comments on commit c1d8401

Please sign in to comment.