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();
};
@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