one-var with --fix is adding multiple empty lines between var declarations on keeping on the same line
See original GitHub issueTell us about your environment
-
ESLint Version: v5.2.0
-
Node Version: 8.11.3
-
npm Version: 5.6.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 5
},
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"one-var": ["error", "never"]
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Input A
var a = 1, b = 2, c = 3;
Output A
var a = 1; var b = 2; var c = 3;
Input B
var a = 1,
b = 2,
c = 3;
Output B
var a = 1;
var b = 2;
var c = 3;
eslint --quiet --fix src/
What did you expect to happen? Do not include multiple lines between variables declaration
Expected output on both cases
var a = 1;
var b = 2;
var c = 3;
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:15 (8 by maintainers)
Top Results From Across the Web
no-multiple-empty-lines - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to add blank lines between definitions? - Stack Overflow
I want a blank line between definitions of structs/classes/functions and between declarations of functions. Currently, when formatting, clang- ...
Read more >GNU make
A recipe may have more than one command, either on the same line or each ... We give the force target an empty...
Read more >tslint-eslint-rules - npm Package Health Analysis | Snyk
Snyk scans all the packages in your projects for vulnerabilities and ... the same variable more than once (https://eslint.org/docs/rules/recommended).
Read more >Rules - JavaScript Standard Style
Keep else statements on the same line as their curly braces. ... operator in a multi-line setting, place ? and : on their...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is a bug when the fix cause more problems, like including useless empty lines between declarations. That is not acceptable on any style-guide.
reopen please, the current behavior is quite annoying when
--fix
is applied on a large legacy codebase