GithubHelp home page GithubHelp logo

Comments (5)

cspotcode avatar cspotcode commented on July 3, 2024 1

Thanks! And thanks for the quick fix on those other 2 issues.

This module is saving me a ton of time. Often I wish tsc did something slightly different (logging diagnostics as JSON, skipping the typechecker, etc) It's historically been too annoying to re-implement the basic tsc infrastructure to get to a point where I can implement my behavior on top. @ts-tools/service makes it super-easy.

from ts-tools.

AviVahl avatar AviVahl commented on July 3, 2024

I wanted this for @ts-tools/node as well. Will probably add support for it soon.
Appreciate the feedback!

from ts-tools.

cspotcode avatar cspotcode commented on July 3, 2024

Here's the workaround I'm using for this, similar to the workaround in #9.

import { TypeScriptService } from '@ts-tools/service';
const service = new TypeScriptService();
// Trigger discovery and parsing of tsconfig
service.transpileFile('DOES NOT EXIST.ts', {
  tsconfigFileName : 'tsconfig.json',
  getCompilerOptions = (baseHost, tsconfigOptions) =>tsconfigOptions
});
const runningService = service.runningServices.get('tsconfig.json')!;
// Get parsed compiler options
const parsedCompilerOptions = runningService.languageService.getProgram()!.getCompilerOptions();
// transpile file *without* typechecking *with* our tsconfig's compiler options
service.transpileFile('foo.ts', {
  isolated: true,
  getCompilerOptions = (baseHost, tsconfigOptions) =>parsedCompilerOptions
});

from ts-tools.

AviVahl avatar AviVahl commented on July 3, 2024

Happy to hear this package helps others. 👍

I already have some WIP to resolve this issue, but it might have to wait for the weekend, when I have more free time.

from ts-tools.

AviVahl avatar AviVahl commented on July 3, 2024

apologies for the delay. going to release [email protected] that allows this.

from ts-tools.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.