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

[v4] indent: false positive with multi-line async function call + destructuring assignment #8815

Closed
emmettnicholas opened this issue Jun 27, 2017 · 1 comment · Fixed by #8837
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly indent Relates to the `indent` rule rule Relates to ESLint's core rules

Comments

@emmettnicholas
Copy link

emmettnicholas commented Jun 27, 2017

Tell us about your environment

  • ESLint Version: 4.1.1
  • Node Version: 4.3.1
  • npm Version: 2.14.12

What parser (default, Babel-ESLint, etc.) are you using?

babel-eslint 7.2.3

Please show your full configuration:

{
    "env": {
        "node": true,
        "es6": true,
    },
    "parser": "babel-eslint",
    "parserOptions": {
        "ecmaFeatures": {
            "arrowFunctions": true,
            "forOf": true,
            "defaultParams": true,
            "destructuring": true,
            "objectLiteralShorthandProperties": true,
            "restParams": true,
            "spread": true,
        },
    },
    "rules": {
        "indent": ["warn", 4, {"SwitchCase": 1}],
    }
}

What did you do? Please include the actual source code causing the issue.

async function test() {
    const {
        foo,
        bar,
    } = await doSomethingAsync(
        1,
        2,
        3,
    );
}

What did you expect to happen?

No errors

What actually happened? Please include the actual, raw output from ESLint.

  6:1  warning  Expected indentation of 12 spaces but found 8  indent
  7:1  warning  Expected indentation of 12 spaces but found 8  indent
  8:1  warning  Expected indentation of 12 spaces but found 8  indent
  9:1  warning  Expected indentation of 8 spaces but found 4   indent

NOTES:

  • It works if I remove the async keyword
  • It works if I don't use destructuring assignment
  • It works if I don't split the function arguments into multiple lines
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 27, 2017
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly indent Relates to the `indent` rule rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jun 27, 2017
@not-an-aardvark
Copy link
Member

Thanks for reporting, I can reproduce this issue.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly indent Relates to the `indent` rule rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants