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

False positive "space-before-keywords" for function in array #4569

Closed
spence opened this issue Nov 28, 2015 · 4 comments
Closed

False positive "space-before-keywords" for function in array #4569

spence opened this issue Nov 28, 2015 · 4 comments
Assignees
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

@spence
Copy link

spence commented Nov 28, 2015

Spaces before keyword function when it's the first item in an array should not cause an error.

'use strict';
(function () {
  window._ = [function () { }];
})();
3:15  error  Missing space before keyword "function"  space-before-keywords

eslint version: v1.10.2

Rule:

"space-before-keywords": [2, "always"]
@eslintbot
Copy link

@spence Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Nov 28, 2015
@platinumazure
Copy link
Member

Yes, this is a conflict with array-bracket-spacing and I would agree this
rule should not be enforced in that situation. I think the colon space rule
will also be problematic in the object case (can someone check that?).
On Nov 28, 2015 4:50 PM, "ESLint Bot" notifications@github.com wrote:

@spence https://github.com/spence Thanks for the issue! If you're
reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule
http://eslint.org/docs/developer-guide/contributing/new-rules for
instructions.


Reply to this email directly or view it on GitHub
#4569 (comment).

@alberto alberto 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 Nov 29, 2015
@alberto alberto self-assigned this Nov 29, 2015
@alberto
Copy link
Member

alberto commented Nov 29, 2015

Should this be tagged enhancement @eslint/eslint-team?

@nzakas
Copy link
Member

nzakas commented Nov 30, 2015

No, I think bug is correct

nzakas added a commit that referenced this issue Nov 30, 2015
Fix: Ignore space before function in array start (fixes #4569)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 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 7, 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

5 participants