Skip to content

📎 Implement lint/noEmptyBlockStatements - eslint/no-empty eslint/no-empty-static-block #39

Closed

Description

@Conaclos

Description

This lint rule should integrate both no-empty and no-empty-static-block rules.

Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.

Activity

  1. changed the title [-]📎 lint/noEmptyBlockStatements[/-] [+]📎 `lint/noEmptyBlockStatements`[/+] on Aug 23, 2023
  2. changed the title [-]📎 `lint/noEmptyBlockStatements`[/-] [+]📎 Implement `lint/noEmptyBlockStatements`[/+] on Aug 23, 2023
  3. changed the title [-]📎 Implement `lint/noEmptyBlockStatements`[/-] [+]📎 Implement `lint/noEmptyBlockStatements` - `eslint/no-empty` `eslint/no-empty-static-block`[/+] on Aug 23, 2023
  4. ematipico commented on Aug 28, 2023

    @ematipico
    Member

    What's the difference between this rule and #42? It's worth an explanation in the description

  5. Conaclos commented on Aug 28, 2023

    @Conaclos
    MemberAuthor

    What's the difference between this rule and #42? It's worth an explanation in the description

    In contrast to #42, the rule prohibits any empty block statements.
    Examples of incorrect code:

    if (cond) {}
    
    while (cond) {}
    
    function f() {}

    However, the following example also triggers #42:

    {}
  6. ematipico commented on Aug 28, 2023

    @ematipico
    Member

    So we would have two rules that trigger the same code? That doesn't seem right to me.

    I wonder if at this point if we should have only one rule that handles all the block statements. Or at least make sure that they don't conflict each other.

  7. Conaclos commented on Aug 28, 2023

    @Conaclos
    MemberAuthor

    I wonder if at this point if we should have only one rule that handles all the block statements

    I think you are right. We could thus regroup these two rule under the noUselessBlockStatements name.

  8. andrewangelle commented on Oct 8, 2023

    @andrewangelle
    Contributor

    Hello! If a fix for this issue is still needed, I'd like to give it a shot.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Good first issueStatus: Good for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions