Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: Add never option to arrow-body-style (fixes #6317) #6318

Merged
merged 4 commits into from Jun 9, 2016

Commits on Jun 3, 2016

  1. Update: Add never option to arrow-body-style (fixes eslint#6317)

    Arrow functions that return object literals can look very similar to arrow functions with brace bodies.  Some syntactic ambiguity can be avoided by disallowing block-style arrow functions in favour of ES5 function expressions.
    
    **Outcome**
    
    The following patterns are considered problems:
    ```
    /*eslint arrow-body-style: ["error", "never"]*/
    /*eslint-env es6*/
    
    let foo = () => {
        return 0;
    };
    
    let foo = (retv, name) => {
        retv[name] = true;
        return retv;
    };
    ```
    
    The following patterns are not considered problems:
    ```
    /*eslint arrow-body-style: ["error", "never"]*/
    /*eslint-env es6*/
    
    let foo = () => 0;
    
    let foo = () => ({ key: 0 });
    ```
    ajhyndman committed Jun 3, 2016
    Copy the full SHA
    f862809 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2016

  1. Update documentation

    ajhyndman committed Jun 8, 2016
    Copy the full SHA
    1899651 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    dd480d5 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    44fbf7c View commit details
    Browse the repository at this point in the history