Skip to content

tsconfig path aliases not resolved for .gts (Glimmer TypeScript) files #270

@square-brackets

Description

@square-brackets

Summary

When a .gts file (Glimmer TypeScript — used in Ember.js / Glimmer.js) imports a module via a tsconfig path alias, fallow does not resolve the alias and the imported module appears unreachable.

Environment

  • fallow 2.62.0
  • Ember.js monorepo (pnpm workspaces)

Reproduction

tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "my-app/*": ["./app/*"]
    }
  }
}

app/components/my-component.gts:

import MyService from 'my-app/services/my-service';

export default class MyComponent extends Component {
  @service declare myService: MyService;
}

Where app/services/my-service.ts exists on disk.

Result: fallow reports app/services/my-service.ts as unused.

Expected: fallow resolves my-app/services/my-serviceapp/services/my-service.ts via the tsconfig path alias, the same way it does when the import appears in a .ts file.

Context

The workspaces documentation states: "Path aliases from each package's tsconfig.json are used when resolving imports within that package." This works correctly for .ts importers but not for .gts importers.

.gts is the standard TypeScript file format for Glimmer components — syntactically TypeScript with an embedded <template> block, part of the Glimmer Component Authoring Format. tsconfig path aliases should apply to it the same way they apply to .ts.

Workaround

Adding the affected directories to entry in .fallowrc.json suppresses the false positives but also prevents fallow from detecting genuinely dead files in those directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions