Skip to content

ts-lce fails when tsconfig.json contains a path reference to a file #125

@JohT

Description

@JohT

According to the Typescript documentation, it is also possible to specify files as path references in the tsconfig.json configuration:

{
  "references": [
    { "path": "./tsconfig.ui.json" }
  ]
}

In that case, ts-lce fails with an error message like this:

ENOTDIR: not a directory, open '.../jqassistant-typescript-plugin/typescript/test/core/integration/sample-projects/path-references/tsconfig.ui.json/tsconfig.json'

      102 |     private static parseTsConfig(projectRoot: string): ParsedCommandLine {
      103 |         const tsConfigPath = path.join(projectRoot, "tsconfig.json");
    > 104 |         const configFileText = fs.readFileSync(tsConfigPath, 'utf8');
          |                                   ^
      105 |         const configFileSourceFile = createSourceFile(
      106 |             'tsconfig.json', configFileText, ScriptTarget.JSON
      107 |         );

      at Function.parseTsConfig (src/core/utils/project.utils.ts:104:35)
      at Function.getProjectInfo (src/core/utils/project.utils.ts:74:31)
      at Function.getProjectInfo (src/core/utils/project.utils.ts:80:46)
      at Function.determineProjects (src/core/utils/project.utils.ts:46:37)
      at Object.<anonymous> (test/core/integration/path-references.test.ts:9:49)

Reproducer: #126

If contributions are welcome I could give It a try of course in sync with you discussing/reviewing my pull request.

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