-
Notifications
You must be signed in to change notification settings - Fork 356
Open
Description
Refer to the following fiddle: http://astexplorer.net/#/27xKOBJJGN
When I have an object with a structure such as this:
const styles = {
base: {
height: '100%',
},
ribbon: {
backgroundColor: 'black',
},
};and I do anything with the body of the ObjectExpression like this:
export default function(file, api) {
const j = api.jscodeshift;
window.j = j;
const { statement, statements } = j.template;
return j(file.source)
.find(j.VariableDeclarator)
.replaceWith(p => {
p.node.init = j.objectExpression(p.node.init.properties);
return p.node;
})
.toSource();
};then the following output is gotten:
const styles = {
base: {
height: '100%',
},
ribbon: {
backgroundColor: 'black',
}
};see that extra newline after base and before ribbon. These lines are added after every property, which is adding unnecessary changes to my codebase. Is there a way to suppress that? or is that a bug?
anthony-neontribe, RustyToms, petrfelzmann, petrvecera, verekia and 15 morejamie-pate
Metadata
Metadata
Assignees
Labels
No labels