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

FunctionDeclaration not working with nested functions #7249

Closed
RecuencoJones opened this issue Sep 26, 2016 · 2 comments
Closed

FunctionDeclaration not working with nested functions #7249

RecuencoJones opened this issue Sep 26, 2016 · 2 comments
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 rule Relates to ESLint's core rules

Comments

@RecuencoJones
Copy link

Tell us about your environment

  • ESLint Version: 3.6.0
  • Node Version: 6.3.0
  • npm Version: 3.10.6

What parser (default, Babel-ESLint, etc.) are you using?
gulp-eslint@3.0.1 and default

Please show your full configuration:
Affected rule:

...
"indent": [2, 2, {
  "FunctionDeclaration": {"body": 1, "parameters": 2}
}],
...

What did you do? Please include the actual source code causing the issue.
Cannot publish the original source, but some file having nested functions like:

function a(param1, param2,
    param3) {
  var var1, var2, var3;

  function internal(paramA, paramB,
      paramC) {
    var varA, varB, varC;

    ...
  }
}

Run ./node_modules/.bin/eslint app/ -c .eslintrc

What did you expect to happen?
No errors in the console.

What actually happened? Please include the actual, raw output from ESLint.
error Expected indentation of 4 spaces but found 6 indent at line of paramC.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 26, 2016
@not-an-aardvark
Copy link
Member

I can reproduce this issue. I'll investigate it sometime tomorrow if no one else gets around to it by then.

@mysticatea mysticatea added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 27, 2016
@mysticatea
Copy link
Member

Thank you for this issue.

I confirmed it on our online demo.
It seems to expect always 4 indentation for some reason.

image

not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Sep 27, 2016
@RecuencoJones RecuencoJones changed the title FunctionDeclaration now working with nested functions FunctionDeclaration not working with nested functions Sep 28, 2016
not-an-aardvark added a commit to not-an-aardvark/eslint that referenced this issue Sep 30, 2016
@nzakas nzakas closed this as completed in 332d213 Sep 30, 2016
@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 rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

4 participants