Use case
Framework
Owner
Correct Ts Specifiers
This package transforms import specifiers in source-code from the broken state TypeScript's compiler (
tsc
) required (prior TypeScript v5.7 RC) into proper ones. This is useful when source-code is processed by standards-compliant software like Node.js. This is a one-and-done process, and the updated source-code should be committed to your version control (ex git); thereafter, source-code import statements should be authored compliant with the ECMAScript (JavaScript) standard.Sveltekit Vite Preprocess Migration
This codemod updates import paths and ensures compatibility with changes in library structures. In this example, it modifies the import statement for vitePreprocess to reflect updates in the library's API.
Goto To Location Href
Codemod Description
This codemod is designed to replace specific patterns in TypeScript files with updated code logic. It transforms instances of
goto($A)
intowindow.location.href = $A;
when the$A
value is a URL starting withhttp://
orhttps://
. This refactor makes external navigation more explicit by usingwindow.location.href
.React/Update React Imports
This codemod transforms React imports to use named imports instead of default or namespace imports. This helps reduce bundle size by allowing better tree-shaking of unused React exports.
Event Handling On Change
This codemod automates the update of your
onChange
event handler function to support the newDescendant[]
type and selection handling introduced in version 0.104.Insert Nodes
Theis transformation ensures that calls to
Transforms.insertNodes
in the updated API remain functional and behave identically to their usage in the older API (v0.88) while adhering to the new, more explicit parameterization.Editor Has Path
This guide covers the migration of
Editor.hasPath
usage from Slate.js v0.88 to v0.104. The API has changed from a property-based check to a function call pattern, requiring updates to existing code.Editor Has Block
Transform
Editor.hasBlock
toEditor.nodes
This codemod replaces occurrences of Editor.hasBlock with the equivalent Editor.nodes structure. The transformation updates the code to use a more modern API, ensuring compatibility and improved functionality.
Custom Renderers
This codemod updates the
renderElement
function to include TypeScript typings and adds a default case for rendering unsupported element types.Deno Replace Import Assertions
This codemod helps migrate JavaScript/TypeScript files from using the deprecated import assertions syntax to the updated import attributes syntax. The change aligns with the updated proposal for import attributes and ensures compatibility with newer versions of runtimes like Deno 2 and modern browsers that have already removed support for import assertions.
Deno Refactor TLS Certs Reading
This codemod updates the usage of TLS certificate loading in Deno by replacing deprecated properties with their new counterparts. In Deno V2, loading certificates directly from files is now deprecated. Instead, you should read the certificates yourself.
Deno Import STL Types
This codemod updates deprecated Deno typescript interfaces in your codebase. It automatically imports the necessary typscript interfaces from the standard library
Deno Import Stl Functions
This codemod updates removed Deno function calls in Deno v2 to their new equivalents from the standard library It also automatically adds the necessary import statements from the appropriate modules.
Flatten Deno.Json
This codemod helps developers migrate their deno.json configuration files to the new flattened schema format, making them easier to read and write. It automates the transformation of nested properties to their new top-level structure as outlined in recent Deno updates.
Refactor Native Module Calls
This codemod updates your React Native code to use the New Architecture's synchronous native module calls, replacing callback-based patterns for improved performance and simplicity.
Remix/2/React Router/Upgrade
This codemod automates most of the manual steps outlined in the Remix to React Router upgrade guide.
React Router/6/UseHistory To UseNavigate
This codemod migrates
useHistory
touseNavigate
in React Router codebases. It replacesuseHistory
imports and updates all instances ofhistory.push
,history.replace
,go
,goBack
, andgoForward
to align with theuseNavigate
API.React Router/6/Switch To Routes
This codemod updates
Switch
components toRoutes
in React Router, in line with React Router v6 and newer. It also adjusts the imports, replacingSwitch
withRoutes
inreact-router-dom
import statements.React Router/6/Migrate StaticRouter Import
This codemod updates imports of
StaticRouter
to use thereact-router-dom/server
package instead ofreact-router-dom
, in line with updated React Router requirements.React Router/6/Replace UseRouteMatchWithUseMatch
This codemod updates
useRouteMatch
calls to the neweruseMatch
function inreact-router-dom
. It also adjusts any arguments passed touseRouteMatch
, changingstrict
toend
andsensitive
tocaseSensitive
. Additionally, it ensures that imports are updated to reflect the removal ofuseRouteMatch
.