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

Indent rule reports false: multi-line + fat arrow #2239

Closed
necolas opened this issue Apr 6, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@necolas
Copy link

commented Apr 6, 2015

Noticed this inconsistency in indentation reporting (v0.18.0).

['a', 'b', 'c', 'd',
    'e', 'f', 'g'].forEach(function (letter) {
  console.log(letter);
});

No errors.

['a', 'b', 'c', 'd',
    'e', 'f', 'g'].forEach((letter) => {
  console.log(letter);
});

Produces the error:

3:3 error  Expected indentation of 6 characters           indent
@nzakas

This comment has been minimized.

Copy link
Member

commented Apr 6, 2015

Thanks, will take a look.

@justin808

This comment has been minimized.

Copy link

commented Apr 26, 2015

A related issue if using the airbnb eslint style guidelines:

29:17  error    Block must not be padded by blank lines  padded-blocks
import React from 'react';
import Comment from './Comment';

const CommentList = React.createClass({
  displayName: 'CommentList',

  propTypes: {
    comments: React.PropTypes.array
  },

  render() {
    const reversedData = this.props.comments.slice(0).reverse();
    const commentNodes = reversedData.map((comment, index) => {
      // `key` is a React-specific concept and is not mandatory for the
      // purpose of this tutorial. if you're curious, see more here:
      // http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
      return (
        <Comment author={comment.author} key={index} text={comment.text}/>
      );
    });

    return (
      <div className="commentList">
        {commentNodes}
      </div>
    );
  }
});

export default CommentList;
@nzakas

This comment has been minimized.

Copy link
Member

commented Apr 26, 2015

@justin808 that's not related to this issue. Can you open a new issue for that?

@necolas

This comment has been minimized.

Copy link
Author

commented Apr 27, 2015

@nzakas @justin808 i think that's the same as #2211

@bgw

This comment has been minimized.

Copy link
Contributor

commented May 28, 2015

I think this is the same issue: https://gist.github.com/bgw/c2ace2fd7b82917cb263

gyandeeps added a commit that referenced this issue Jul 14, 2015

@gyandeeps gyandeeps closed this in d6cdd33 Jul 14, 2015

ilyavolodin added a commit that referenced this issue Jul 14, 2015

Merge pull request #2988 from eslint/issue2239
Fix: multi-line + fat arrow indent (fixes #2239)

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.