joshwcomeau/new-component

Add "Undo" functionality

Aperta

#6 aperta il 6 set 2017

 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (138 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (758 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Often, I'll realize right after creating a component that I did it wrong.

Maybe I meant to make a functional component, but forgot the flag. Maybe I realized it has the wrong name (or I typo'ed the name).

Right now the solution is rm -rf src/components/ThingYouJustCreated, which is a little burdensome, and I worry I might make a mistake with that and delete the wrong thing.

I think it'd be neat if you could do:

$ new-component-undo

This will delete the component 'ThingYouJustCreated`. 
Press enter to continue, or any other key to cancel.

Guida contributor