Skip to content

Commit 6b04eed

Browse files
committed
TypeScript: Fix errors on special keys
1 parent b0fa6ac commit 6b04eed

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.changeset/fifty-icons-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fumadocs-typescript': patch
3+
---
4+
5+
Fix errors on special keys

packages/typescript/src/lib/remark-auto-type-table.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import type { Root } from 'mdast';
22
import type { Transformer } from 'unified';
3-
import type { ExpressionStatement, ObjectExpression, Property } from 'estree';
4-
import type { Program } from 'estree';
3+
import type {
4+
ExpressionStatement,
5+
ObjectExpression,
6+
Program,
7+
Property,
8+
} from 'estree';
59
import { createGenerator, type DocEntry, type Generator } from '@/lib/base';
610
import { renderMarkdownToHast } from '@/markdown';
711
import { valueToEstree } from 'estree-util-value-to-estree';
@@ -48,8 +52,8 @@ async function mapProperty(
4852
shorthand: false,
4953
computed: false,
5054
key: {
51-
type: 'Identifier',
52-
name: entry.name,
55+
type: 'Literal',
56+
value: entry.name,
5357
},
5458
kind: 'init',
5559
value,

0 commit comments

Comments
 (0)