Tiptap 2 Migrate Imports

1.0.1Last update Jan 29, 2025
by@nperez0111

This is a codemod created with codemod init.

Using this codemod

You can run this codemod with the following command:

npx codemod tiptap-2-migrate-imports

Before

import Table from '@tiptap/extension-table';
import TableRow from '@tiptap/extension-table-row';
import TableCell from '@tiptap/extension-table-cell';
import TableHeader from '@tiptap/extension-table-header';

After

import {
Table,
TableRow,
TableCell,
TableHeader,
} from '@tiptap/extension-table';

,

Before

import { Table } from '@tiptap/extension-table';
import { TableRow } from '@tiptap/extension-table-row';
import { TableCell } from '@tiptap/extension-table-cell';
import { TableHeader } from '@tiptap/extension-table-header';

After

import {
Table,
TableRow,
TableCell,
TableHeader,
} from '@tiptap/extension-table';

,

Before

import Table1 from '@tiptap/extension-table';
import TableR from '@tiptap/extension-table-row';
import TableCel from '@tiptap/extension-table-cell';
import TableHead from '@tiptap/extension-table-header';

After

import {
Table as Table1,
TableRow as TableR,
TableCell as TableCel,
TableHeader as TableHead,
} from '@tiptap/extension-table';

,

Before

import BulletList from '@tiptap/extension-bullet-list';
import OrderedList from '@tiptap/extension-ordered-list';
import ListItem from '@tiptap/extension-list-item';

After

import { BulletList, OrderedList, ListItem } from '@tiptap/extension-list';

,

Before

import TextStyle from '@tiptap/extension-text-style';
import { Color } from '@tiptap/extension-color';

After

import { TextStyle, Color } from '@tiptap/extension-text-style';

,

Before

import { PlaceHolder } from '@tiptap/extension-placeholder';
import History from '@tiptap/extension-history';

After

import { PlaceHolder, History } from '@tiptap/extensions';

Build custom codemods

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

background illustrationGet Started Now