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?
Refer to the following fiddle: http://astexplorer.net/#/27xKOBJJGN
When I have an object with a structure such as this:
and I do anything with the body of the ObjectExpression like this:
then the following output is gotten:
see that extra newline after
baseand beforeribbon. 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?