question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement a codemod for syntax changes we can detect

See original GitHub issue
  • <https://mdxjs.com> => [https://mdxjs.com](https://mdxjs.com)
  • <3 => &lt;3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wooormcommented, Aug 8, 2022

Last comment still holds. A proper code mod is really complex. I’m not sure how much data you have. I recommend using remark with remark-mdx on your docs folder:

remark -u remark-mdx docs/

It’ll throw errors with pretty descriptive messages. With that, and some regex kung-fu, you should be able to get far.


Hashicorp had something somewhat working for this, but it was still missing things. Let me know if you‘re interested in getting your hands dirty and improving that project and I’ll ping folks!

0reactions
karlhorkycommented, Aug 8, 2022

Is there currently a codemod to convert MDX v1 code to v2? We have a lot of content written in MDX v1 and would like to avoid rewriting manually by hand if possible.

I saw https://github.com/mdx-js/codemods, but it seems a bit old…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write Code to Rewrite Your Code: jscodeshift - Toptal
Codemods are scripts used to rewrite other scripts. Think of them as a find and replace functionality that can read and write code....
Read more >
Codemods: A Quick and Easy Way to Automate Code ...
This article will show you how you can automate large-scale refactoring tasks with the use of codemods and the JSCodeshift tool, allowing you...
Read more >
A Codemod Survival Guide - Herding Lions - Ben McCormick
Do you like making repetitive syntax updates across many files? Enjoy the thrill of painstakingly combing through 1000 line diffs that all look ......
Read more >
Writing your very first codemod with jscodeshift - Medium
The simplest way to identify the correct type definition you need is to highlight the code you are looking to transform in the...
Read more >
My Workflow for Codemods - Spencer Miskoviak
A walk-through of my workflow for creating custom codemods.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found