question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

one-var-declaration-per-line doesn't support jscs behavior

See original GitHub issue

Tell us about your environment

  • ESLint Version: 3.6.0

The corresponding JSCS rule requireLineBreakAfterVariableAssignment defines the following to be invalid:

var abc = 8; var foo = 5;

var a, b, c,
    foo = 7, bar = 8;

The ESLint rule one-var-declaration-per-line catches the second example, but not the first. This rule should support linting for there only being one declaration per line. 😃

This should fail:

/*eslint one-var-declaration-per-line: ["error", "always"]*/
/*eslint-env es6*/

var abc = 8; var foo = 5;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
albertocommented, Apr 14, 2018

I think this can be catched by padding-line-between-statements:

/*eslint padding-line-between-statements: [
    "error",
    { blankLine: "always", prev: "var", next: "var" }
]*/

var abc = 8; var foo = 5;

See in demo site

1reaction
kaicataldocommented, Sep 3, 2017

@eslint/eslint-team One more friendly ping. This is one of the few remaining unaccepted JSCS issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

missing rule: require line break after variable assignment #1622
I've tried to review each and every rule of JSHint, JSCS and ESLint to ... one-var-declaration-per-line doesn't support jscs behavior #7245.
Read more >
fluid-eslint | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Disallow \8 and \9 escape sequences in string literals (no ...
This rule disallows \8 and \9 escape sequences in string literals. Examples of incorrect code for this rule: /*eslint no-nonoctal-decimal ...
Read more >
Diff - 402e1b6e55e9041dfd1a93580e45e5c5dba1db55^!
For the purposes + of this License, Derivative Works shall not include ... (molee1905) +* 6f3faa4 Revert "Build: Remove support for Node v5 ......
Read more >
Malware Configuration - Joe Sandbox
Overview; Malware Configuration; Behavior Graph; Screenshots ... --lang=en-US --service-sandbox-type=network --enable-audio-service-sandbox ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found