Skip to content
This repository was archived by the owner on Dec 4, 2022. It is now read-only.

Latest commit

 

History

History
292 lines (183 loc) · 7.4 KB

File metadata and controls

292 lines (183 loc) · 7.4 KB

jscodeshift: Refactor JS w/ JS


jscodeshift: Refactor JS w/ JS https://hackmd.io/p/H1Hcn6da-



Please Pull My Plug On Time


Prologue


Scene I

Demo

AST Explorer


Use Cases


Act I: Find


Scene I

Find by astNodeType

AST Explorer


Scene II

Find by filter

AST Explorer


Act II: Replace


Scene I

Modify nodes

AST Explorer


Scene II

insertBefore

AST Explorer


Scene III

replaceWith

AST Explorer


Scene IV

ast-types


Scene V

Tagged template literal

AST Explorer


Act III: Test


Scene I

defineTest


Scene II

defineInlineTest


Act IV: Extend


Scene I

registerMethods

AST Explorer


Scene II

registerMethods for AST node type

AST Explorer


Epilogue


Scene I

Is it safe?

As long as you have backups


Scene II

Is there any API reference?

Yes


Scene III

What's your name?

Folio


Scene IV

What's her name?

Winnie


Scene V

Why don't we use RegExp?

If you are not Chuck Norris. Then the seven angels who had the seven trumpets prepared to sound them. — Revelation 8.6


Reference


Q&A