@@ -111,15 +111,15 @@ export const transpileModule = (
111
111
const program = ts . createProgram ( [ sourceFilePath ] , tsCompilerOptions , compilerHost ) ;
112
112
const typeChecker = program . getTypeChecker ( ) ;
113
113
114
- const transformers : ts . CustomTransformers = {
114
+ const transformers = {
115
115
before : [
116
116
convertDecoratorsToStatic ( config , buildCtx . diagnostics , typeChecker , program ) ,
117
117
performAutomaticKeyInsertion ,
118
118
updateStencilCoreImports ( transformOpts . coreImportPath ) ,
119
119
] ,
120
120
after : [ convertStaticToMeta ( config , compilerCtx , buildCtx , typeChecker , null , transformOpts ) ] ,
121
- afterDeclarations : [ ] ,
122
- } ;
121
+ afterDeclarations : [ ] as ( ts . CustomTransformerFactory | ts . TransformerFactory < ts . SourceFile | ts . Bundle > ) [ ] ,
122
+ } satisfies ts . CustomTransformers ;
123
123
124
124
if ( config . transformAliasedImportPaths ) {
125
125
transformers . before . push ( rewriteAliasedSourceFileImportPaths ) ;
@@ -146,7 +146,7 @@ export const transpileModule = (
146
146
147
147
program . emit ( undefined , undefined , undefined , false , transformers ) ;
148
148
149
- const tsDiagnostics = [ ...program . getSyntacticDiagnostics ( ) ] ;
149
+ const tsDiagnostics = [ ...program . getSyntacticDiagnostics ( ) ] as ts . Diagnostic [ ] ;
150
150
151
151
if ( config . validateTypes ) {
152
152
tsDiagnostics . push ( ...program . getOptionsDiagnostics ( ) ) ;
@@ -156,15 +156,15 @@ export const transpileModule = (
156
156
157
157
results . diagnostics . push ( ...buildCtx . diagnostics ) ;
158
158
159
- results . moduleFile = compilerCtx . moduleMap . get ( results . sourceFilePath ) ;
159
+ results . moduleFile = compilerCtx . moduleMap . get ( results . sourceFilePath ) ! ;
160
160
161
161
return results ;
162
162
} ;
163
163
164
164
const getScriptTargetKind = ( transformOpts : d . TransformOptions ) => {
165
165
const target = transformOpts . target && transformOpts . target . toUpperCase ( ) ;
166
- if ( isNumber ( ( ts . ScriptTarget as any ) [ target ] ) ) {
167
- return ( ts . ScriptTarget as any ) [ target ] ;
166
+ if ( isNumber ( ( ts . ScriptTarget as any ) [ target as string ] ) ) {
167
+ return ( ts . ScriptTarget as any ) [ target as string ] ;
168
168
}
169
169
// ESNext and Latest are the same
170
170
return ts . ScriptTarget . Latest ;
0 commit comments