Skip to content

Commit 6d6f18d

Browse files
authored
fix: Minor updates in linting and documentation (#54)
- fix(docs): Update README examples to correctly import `ShikiHighlighter` as a default export instead of a named export - fix(lint): Remove unused `ShikiTransformer` type import from `utils.ts`
1 parent e459559 commit 6d6f18d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can use either the `ShikiHighlighter` component or the `useShikiHighlighter`
5555
**Using the Component:**
5656

5757
```tsx
58-
import { ShikiHighlighter } from "react-shiki";
58+
import ShikiHighlighter from "react-shiki";
5959

6060
function CodeBlock() {
6161
return (
@@ -114,7 +114,7 @@ Create a component to handle syntax highlighting:
114114

115115
```tsx
116116
import ReactMarkdown from "react-markdown";
117-
import { ShikiHighlighter, isInlineCode } from "react-shiki";
117+
import ShikiHighlighter, { isInlineCode } from "react-shiki";
118118

119119
const CodeHighlight = ({ className, children, node, ...props }) => {
120120
const code = String(children).trim();
@@ -158,7 +158,7 @@ ways to replicate this functionality and API.
158158
`react-shiki` exports `isInlineCode` which parses the `node` prop from `react-markdown` and identifies inline code by checking for the absence of newline characters:
159159

160160
```tsx
161-
import { isInlineCode, ShikiHighlighter } from "react-shiki";
161+
import ShikiHighlighter, { isInlineCode } from "react-shiki";
162162

163163
const CodeHighlight = ({ className, children, node, ...props }) => {
164164
const match = className?.match(/language-(\w+)/);

package/src/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { visit } from 'unist-util-visit';
22

3-
import type { ShikiTransformer } from 'shiki';
43
import type { TimeoutState, Element } from './types';
54

65
/**

0 commit comments

Comments
 (0)