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

jsx-indent interacts badly with indent #899

Closed
Wilfred opened this issue Oct 10, 2016 · 3 comments
Closed

jsx-indent interacts badly with indent #899

Wilfred opened this issue Oct 10, 2016 · 3 comments

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Oct 10, 2016

Given the code:

function foo() {
  const items = [
    <span>foo</span>,
    "bar",
  ];

  return <div>{items}</div>;
}

And the following eslintrc.json file:

{
    "parserOptions": {
        "ecmaVersion": 6,
        "ecmaFeatures": {
            "jsx": true
        }
    },
    "rules": {
        "indent": ["warn", 2],
        "react/jsx-indent": "warn"
    },
    "plugins": [
        "react"
    ]
}

I get the following error:

Expected indentation of 6 space characters but found 4  react/jsx-indent

The problem here is that both indent and react/jsx-indent have opinions on how this line should be indented, and they disagree.

@ljharb
Copy link
Member

ljharb commented Oct 10, 2016

indent is correct here, and I think d0dfc07 might fix it?

@Wilfred
Copy link
Contributor Author

Wilfred commented Oct 10, 2016

I don't currently have a box to check the latest dev version, but I agree this looks a lot like a duplicate of #898.

@yannickcr
Copy link
Member

The fix should be published in the coming hour. Please reopen #898 if you still encounter the problem with v6.4.1.

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

No branches or pull requests

3 participants