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

object-curly-newline and comments. #6381

Closed
mysticatea opened this issue Jun 11, 2016 · 0 comments
Closed

object-curly-newline and comments. #6381

mysticatea opened this issue Jun 11, 2016 · 0 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

@mysticatea
Copy link
Member

From https://twitter.com/ponko2_jp/status/741573129105854465

What version of ESLint are you using?

  • 2.12.0

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

  • default

Please show your full configuration:

  • nothing

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

var obj = {
    // comment.
    a: 1
}
eslint test.js --fix --rule object-curly-newline:error --no-eslintrc --no-ignore

What did you expect to happen?

  • The code isn't modified because the object literal is multiline with a comment and a property.

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

  • The code was modified to:

    var obj = {a: 1}

Currently, this rule checks whether an object literal is multiline or not by comparing the following 2 tokens.

  • The next token of the open brace.
  • The previous token of the close brace.

So comments are ignored.
I think this rule should check comments as well.

@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 labels Jun 11, 2016
@mysticatea mysticatea self-assigned this Jun 11, 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

1 participant