Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix transformPaths plugin type to be compatible with interface CustomTransformers #22

Closed
ambroseus opened this issue Dec 21, 2019 · 0 comments · Fixed by #23
Closed

Comments

@ambroseus
Copy link
Contributor

related issue: #11
caused by: jaredpalmer/tsdx#374 (comment)

current transformPaths declaration is not compatible with TS CustomTransformers
it causes type check error when using with rollup-plugin-typescript2 'transformers' option

fix:
-- afterDeclarations(....): ts.Transformer<ts.SourceFile>
++ afterDeclarations(....): ts.Transformer<ts.SourceFile | ts.Bundle>

export function transformPaths(program?: ts.Program, config: Config = {}) {
   ......
    afterDeclarations(
      transformationContext: TransformationContext
    ): ts.Transformer<ts.SourceFile | ts.Bundle> {
      return plugin.before(transformationContext)
    },
  }

  return plugin
}

@zerkalica I will create PR soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant