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

Glint does resolve extends in tsconfig.json from external packages #549

Open
cafreeman opened this issue Mar 28, 2023 · 4 comments
Open
Labels
bug Something isn't working

Comments

@cafreeman
Copy link
Contributor

When extending a tsconfig that includes a glint configuration , glint doesn't follow the extends and, therefore, does not recognize that any config is present.

I've created a reproduction here: https://github.com/cafreeman/glint-extends-bug-repro

@chriskrycho chriskrycho added the bug Something isn't working label Mar 28, 2023
@chriskrycho
Copy link
Member

Clarification—I believe this works correctly for local paths, based on this code:

currentContents.extends && path.resolve(path.dirname(currentPath), currentContents.extends);

If I'm understanding correctly, both from that repro and from our discussion in chat, the issue is specifically that it does not follow an extends which points to a different package, right? Thus meaning that if we, say, set up a @tsconfig/ember-with-glint, it wouldn't be usable.

@cafreeman
Copy link
Contributor Author

Good catch. Yes, you're correct. It only seems to come up when actually extends a tsconfig from another package.

@dfreeman dfreeman changed the title Glint does not read config from extends in tsconfig.json Glint does resolve extends in tsconfig.json from external packages Apr 19, 2023
@NullVoxPopuli
Copy link
Contributor

I think this is resolved, as all projects I'm aware of that use Glint extend from @tsconfig/ember, or some other in-monorepo custom config, such as @my-place-of-work/tsconfig.

@iarroyo
Copy link
Contributor

iarroyo commented Dec 18, 2024

We have faced this issue. We have a vertical micro frontend architecture, so we share some configurations across multiple Ember projects.

We have observed that the glint configuration does not resolve correctly when a tsconfig.json file extends from a package.
To address this situation, we have considered the following three options:

a) Creates a PR to resolve tsconfig.json from a package (favored one)
b) Resolve the tsconfig.json using a path (I would prefer not to go with this option)

{
  "extends": "./node_modules/@package1/tsconfig.json"
}

c) Use the patch-package to patch glint to resolve tsconfig.json from a package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants