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

Add tsconfig.json support to tsc plugin #82

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Conversation

elliotgoodrich
Copy link
Owner

Although I would love if the ecosystem was as mature for non-tsconfig.json projects compared to tsconfig.json projects, this just isn't the case:

  • VSCode works much better with a local tsconfig.json file (e.g. it complains about replaceAll not being a method because we haven't set the correct lib)
  • There is a maximum line length for cmd (8191) that can be quite limiting when passing a large number of files via the command line
  • There are certain tsconfig.json options that cannot be passed via the command line (e.g. paths)
  • Existing users will most likely have a tsconfig.json file and it is simpler for them to migrate to ninjutsu-build if they can reuse this
  • There are other tools, such as TypeDoc, that only work with a tsconfig.json file

This commit adds support for a tsconfig.json file in the makeTSCRule and makeTypeCheckRule.

Right now I am unsure whether to overload the makeTSCRule and makeTypeCheckRule or rename the existing ones to makeTSCRuleNoConfig and makeTypeCheckRuleNoConfig simplify the return types.

I will test this change out in building ninjutsu itself and reevaluate.

Although I would love if the ecosystem was as mature for
non-`tsconfig.json` projects compared to `tsconfig.json` projects, this
just isn't the case:

  * VSCode works much better with a local `tsconfig.json` file (e.g. it
    complains about `replaceAll` not being a method because we haven't
    set the correct `lib`)
  * There is a maximum line length for `cmd` (8191) that can be quite
    limiting when passing a large number of files via the command line
  * There are certain `tsconfig.json` options that cannot be passed via
    the command line (e.g. `paths`)
  * Existing users will most likely have a `tsconfig.json` file and it
    is simpler for them to migrate to `ninjutsu-build` if they can reuse
    this
  * There are other tools, such as TypeDoc, that only work with a
    `tsconfig.json` file

This commit adds support for a `tsconfig.json` file in the `makeTSCRule`
and `makeTypeCheckRule`.

Right now I am unsure whether to overload the `makeTSCRule` and
`makeTypeCheckRule` or rename the existing ones to `makeTSCRuleNoConfig`
and `makeTypeCheckRuleNoConfig` simplify the return types.

I will test this change out in building `ninjutsu` itself and
reevaluate.
@elliotgoodrich elliotgoodrich merged commit 0d68c2b into main Jun 8, 2024
11 checks passed
@elliotgoodrich elliotgoodrich deleted the support-tsconfig branch June 8, 2024 13:37
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 this pull request may close these issues.

None yet

1 participant