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

feat: add shareable tsconfig support #1397

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

p-chan
Copy link

@p-chan p-chan commented Aug 1, 2023

I used get-tsconfig to support tsconfig extends property.
Fix #1283

@p-chan p-chan force-pushed the feature/add-shareable-tsconfig-support branch from 7fda278 to 2bc2c09 Compare August 1, 2023 13:16
@p-chan p-chan marked this pull request as ready for review August 8, 2023 19:59
Copy link
Member

@fbartho fbartho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection for this feature in concept, let’s just not pull in a new dependency for it.

Thanks!

@@ -126,7 +126,7 @@ export const typescriptify = (content: string, dir: string): string => {
let compilerOptions: any
const tsConfigPath = lookupTSConfig(dir)
if (tsConfigPath) {
compilerOptions = JSON5.parse(fs.readFileSync(tsConfigPath, "utf8"))
compilerOptions = parseTsconfig(tsConfigPath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project already depends on TypeScript (see line 123), so it’s not helpful for us to pull in a 3rd-party package whose purpose is to parseTsconfig without a dependency on TypeScript!

Instead, I’d accept a PR that usests.parseConfig or a similar API that supports extends from the official dependency — that we’re already pulling in.

@fbartho
Copy link
Member

fbartho commented Sep 10, 2023

This PR looks like it’s a duplicate to #1313 — and that one has tests and an approach that better matches my feedback above.

Not sure why that one stalled out though! So you might be able to pick up from where they started, or at least use it as a hint.

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

Successfully merging this pull request may close these issues.

[BUG] tsconfig.json "extends" field not parsed by transpiler
2 participants