Skip to content

Commit a5bbffd

Browse files
committed
chore: set a type for compilerOptions
1 parent 2985663 commit a5bbffd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { FilterPattern } from '@rollup/pluginutils'
2-
import type { JscConfig, Options as SwcOptions, TransformConfig } from '@swc/core'
2+
import type { JscConfig, JscTarget, Options as SwcOptions, TransformConfig } from '@swc/core'
3+
import type { CompilerOptions } from 'typescript'
34
import path from 'node:path'
45
import { createFilter } from '@rollup/pluginutils'
56
import { transform } from '@swc/core'
@@ -37,7 +38,7 @@ export default createUnplugin<Options | undefined, false>(
3738
if (!filter(id))
3839
return null
3940

40-
const compilerOptions
41+
const compilerOptions: CompilerOptions
4142
= tsconfigFile === false
4243
? {}
4344
: loadTsConfig(
@@ -81,7 +82,7 @@ export default createUnplugin<Options | undefined, false>(
8182
}
8283

8384
if (compilerOptions.target) {
84-
jsc.target = compilerOptions.target
85+
jsc.target = compilerOptions.target as unknown as JscTarget
8586
}
8687

8788
if (compilerOptions.useDefineForClassFields != null) {

0 commit comments

Comments
 (0)