Next/15/Refactor Imports From @Next/Font To Next/Font

/icons/calendar.svg

Last update

Aug 30, 2024

Refactor Imports from @next/font to next/font

This codemod refactors import statements in your code to replace @next/font with next/font, aligning with the latest Next.js module structure.

  • Find Import Declarations: Identifies all ImportDeclaration nodes in the code.

  • Check Import Path: Ensures that the import path starts with @next/font.

  • Replace Import Path: Updates the import path to use next/font instead of @next/font.

Before

// Before
import { Inter } from "@next/font/google";

After

// After
import { Inter } from "next/font/google";

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now