Home

Awesome

undecorate-codemod Build Status

A small codemod to "undecorate" Class Declarations that have decorators, for use with JSCodeshift.

Why?

For more on why this was created, see my blog post: Undecorate Your Decorators

Setup & Run

What's Supported

This codemod undecorates Class Declarations, for any number of decorators and works whether or not the class is a named export, default export or not exported at all. For example:

Example input:

@withParam('myParam')
@noParam
@taggedTemplate`my tagged template string`
class MyClass { }

Converts to:

const MyClass = withParam('myParam')(noParam(taggedTemplate`my tagged template string`(class MyClass { })));

Things to be aware of

Credit & Thanks