Skip to content

Instantly share code, notes, and snippets.

@torifat
Last active January 29, 2016 15:58
Show Gist options
  • Save torifat/83da48336867e128f2ca to your computer and use it in GitHub Desktop.
Save torifat/83da48336867e128f2ca to your computer and use it in GitHub Desktop.
$ jscodeshift -t ../codemod/static-property-semicolon.js src/
export default function(file, api) {
const j = api.jscodeshift;
const { expression, statement, statements } = j.template;
return j(file.source)
.find(j.ClassProperty)
.replaceWith(p => {
p.node.end++;
return p.node;
})
.toSource();
};
@0x80
Copy link

0x80 commented Jan 8, 2016

line 3 is not adding anything

@torifat
Copy link
Author

torifat commented Jan 9, 2016

@0x80 yeah, it was from the boilerplate. Thanks for mentioning.

@shark0der
Copy link

Just leaving this here as a reference: jscodeshift -t ../codemod/static-property-semicolon.js src/

@jedwards1211
Copy link

how exactly does p.node.end++ insert a semicolon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment