Spacing in object passed as function argument
See original GitHub issueTell us about your environment
- ESLint Version: eslint@next (v4.0.0-rc.0)
- Node Version: v8.0.0 (Win x86_64)
- npm Version: 5.0.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
{
"env" : {
"browser" : true,
"jquery" : true
},
"rules" : {
"brace-style" : [ "error", "1tbs", {} ],
"comma-spacing" : [ "error", { "before" : false, "after" : true } ],
"comma-style" : [ "error", "last" ],
"space-in-parens" : [ "error", "always" ],
"object-curly-spacing" : [ "error", "always" ]
}
}
What did you do? Please include the actual source code causing the issue.
I have some historically grown code. Tabs and spaces are mixed, commas in front. I called eslint --fix
on that file.
$.ajax(
{ url : '/ajax.cfc?method=myMethod&_cf_nodebug=true'
, type : 'POST'
, data : {}
, success : function( data )
{
console.dir(data);
}
, async : false
} );
What did you expect to happen? There’s a space and a tab after the curly brace in line 2. I expect one of these gone.
What actually happened? Please include the actual, raw output from ESLint.
$.ajax(
{ url : '/ajax.cfc?method=myMethod&_cf_nodebug=true',
type : 'POST',
data : {},
success : function( data ) {
console.dir( data );
},
async : false
} );
The --fix
ed version does not look differently than the input.
Tab and space remained there. In the last line curly brace and bracket are beautifully aligned separated by one space.
I expect bracket and curly brace to from line one and two to be united on one line separated by one space.
I expect the extra space after the curly brace in line two gone.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Ah, I see. So currently,
no-mixed-spaces-and-tabs
only checks for leading whitespace on each line, but doesn’t anything after that. In that case, yes, this is really a feature request - either making a new rule that checks this or enhancingno-mixed-spaces-and-tabs
with an option that would check this.The input! I updated my issue to also contain the output. They differ in the position of the comma. White spaces are identical.