jfeldstein/babel-plugin-export-default-module-exports

View on GitHub

Showing 2 of 2 total issues

Function exit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      exit (path) {
        if (path.BABEL_PLUGIN_EXPORT_DEFAULT_MODULE_EXPORTS) {
          return
        }

Severity: Minor
Found in src/index.js - About 1 hr to fix

    Unnecessary return statement.
    Open

                return
    Severity: Minor
    Found in src/index.js by eslint

    Disallow redundant return statements (no-useless-return)

    A return; statement with nothing after it is redundant, and has no effect on the runtime behavior of a function. This can be confusing, so it's better to disallow these redundant statements.

    Rule Details

    This rule aims to report redundant return statements.

    Examples of incorrect code for this rule:

    /* eslint no-useless-return: "error" */
    
    function foo() { return; }
    
    function foo() {
      doSomething();
      return;
    }
    
    function foo() {
      if (condition) {
        bar();
        return;
      } else {
        baz();
      }
    }
    
    function foo() {
      switch (bar) {
        case 1:
          doSomething();
        default:
          doSomethingElse();
          return;
      }
    }

    Examples of correct code for this rule:

    /* eslint no-useless-return: "error" */
    
    function foo() { return 5; }
    
    function foo() {
      return doSomething();
    }
    
    function foo() {
      if (condition) {
        bar();
        return;
      } else {
        baz();
      }
      qux();
    }
    
    function foo() {
      switch (bar) {
        case 1:
          doSomething();
          return;
        default:
          doSomethingElse();
      }
    }
    
    function foo() {
      for (const foo of bar) {
        return;
      }
    }

    When Not To Use It

    If you don't care about disallowing redundant return statements, you can turn off this rule. Source: http://eslint.org/docs/rules/

    Severity
    Category
    Status
    Source
    Language