Skip to content

Commit 0ada728

Browse files
committed
feat!: use toml-eslint-parser to support toml 1.0.0
1 parent 52be2cb commit 0ada728

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"dependencies": {
4141
"@volar/typescript": "^2.4.0",
42-
"toml": "^3.0.0"
42+
"toml-eslint-parser": "^0.10.0"
4343
},
4444
"peerDependencies": {
4545
"typescript": "^5.0.2"

pnpm-lock.yaml

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dtsContent.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import toml from 'toml'
1+
import { parseTOML, getStaticTOMLValue } from 'toml-eslint-parser'
22
import { Logger } from './logger'
33
import { readFileSync } from 'fs'
44

@@ -11,7 +11,8 @@ export const getDtsContent = (
1111

1212
let dts
1313
try {
14-
const data = toml.parse(text)
14+
const parsed = parseTOML(text)
15+
const data = getStaticTOMLValue(parsed)
1516

1617
dts = `
1718
declare const data = ${JSON.stringify(data)}${useAsConst ? ' as const' : ''}

0 commit comments

Comments
 (0)