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

Rule: newline-per-var #4537

Closed
gajus opened this issue Nov 24, 2015 · 8 comments
Closed

Rule: newline-per-var #4537

gajus opened this issue Nov 24, 2015 · 8 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@gajus
Copy link
Contributor

gajus commented Nov 24, 2015

This rule should warn when multiple variables are declared on the same line.

The following patterns are considered problems:

let date, time, url;

let {foo, bar} = test;

The following patterns are not considered problems:

let date,
    time,
    url;

let {
    foo,
    bar
} = test;
@eslintbot
Copy link

@gajus 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 24, 2015
@gyandeeps
Copy link
Member

Possible duplicate #1622

@gajus
Copy link
Contributor Author

gajus commented Nov 24, 2015

@gyandeeps it isn't.

That rule considers the following example valid.

var a = 42, b = 40, c,
    d = 41;

@gyandeeps
Copy link
Member

Read the discussion at the bottom. We did talk about a lot of things.
If its not an exact duplicate but I think this issue is a variation of #1622 atleast.

@sindresorhus
Copy link
Contributor

let date, time, url;
let {foo, bar} = test;

I wouldn't consider those statements the same. Should at least be separate options in the rule for those.

@gajus
Copy link
Contributor Author

gajus commented Nov 26, 2015

Agreed. The first one is the most important for me. The second one is open to debate.

On Nov 26, 2015, at 03:49, Sindre Sorhus notifications@github.com wrote:

let date, time, url;
let {foo, bar} = test;
I wouldn't consider those statements the same. Should at least be separate options in the rule for those.


Reply to this email directly or view it on GitHub.

@gyandeeps
Copy link
Member

@eslint/eslint-team Thoughts?

@nzakas
Copy link
Member

nzakas commented Dec 22, 2015

We already have too much on the backlog, so closing. Feel free to create a custom rule for this and if we get further requests in the future we can reconsider.

@nzakas nzakas closed this as completed Dec 22, 2015
@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
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

5 participants