# Is is possible to specify the \`tsconfig\` file with the Forge CLI?

**URL:** <https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111>\
**Category:** Forge Platform and Tools\
**Tags:** typescript, forge-cli, forge-lint, forge\
**Created:** [January 16, 2022, 10:45am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111 "2022-01-16T10:45:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [January 16, 2022, 10:45am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/1 "2022-01-16T10:45:34Z")

</div>

I am trying to set up a Tyepescript-based Forge app that uses [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) in the `tsconfig.json` file to specify a separate app and test/spec config:

```auto
{
    "extends": "../../tsconfig.base.json",
    "files": [],
    "include": [],
    "references": [
        {
            "path": "./tsconfig.app.json"
        },
        {
            "path": "./tsconfig.spec.json"
        }
    ],
    "compilerOptions": {
      "baseUrl": "./"
    }
}

```

In this particular case, I am [using NX to generate a node project](https://nx.dev/node/overview) which generates the three `tsconfig` files.

Unfortunately, this particular setup does not seem to play nicely with the Forge CLI which fails at the linting stage with something like:

```auto
Error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/main.ts.
The file must be included in at least one of the projects provided.

```

It seems the error happens because the Forge linter picks the `tsconfig.json` file by default. If I remove project references in the `tsconfig.json` and merge the contents from `tsconfig.app.json` into the file the Forge linter works as expected.

If there was an option to tell the Forge CLI which `tsconfig.json` it should use, I believe this issue would be resolved.

---

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [January 16, 2022, 10:51am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/2 "2022-01-16T10:51:12Z")

</div>

Btw, for `forge deploy` I am currently working around this limitation by using the `--no-verify` option. However, `forge tunnel` does not seem to have an option to disable the linting stage which is a major pain point when trying to achieve an efficient dev loop.

---

<div class="post-metadata">

**Author:** ![scott.dudley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/scott.dudley/32/53884_2.png) [@scott.dudley](https://community.developer.atlassian.com/u/scott.dudley)\
**Post date:** [January 17, 2022, 6:47pm UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/3 "2022-01-17T18:47:46Z")

</div>

Although this does not solve your problem, you might find it helpful to see the following post describing some of the mechanics of how TS is used in the build process (including in “forge tunnel”):

> [@Using alternate version of TypeScript](https://community.developer.atlassian.com/t/using-alternate-version-of-typescript/53002):
>
> Hi Forge team, Is there any supported mechanism planned for using an alternate version of TypeScript? I have an existing codebase running on TS 4.4 that I am trying to get to build on Forge, but it is…not easy. I was able to hack it into a working state, but I wouldn’t want to ship anything with this amount of duct tape. This creates a blocker for anyone who has a project built with a newer version of TS than yours, but who cannot (or doesn’t want to) backport the entire project syntax to an e…

---

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [January 18, 2022, 2:26am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/4 "2022-01-18T02:26:39Z")

</div>

Thank you for sharing that thread, Scott. The points you highlighted made me think that the TS problems may go much further than I initially assumed, in particular with regards to the TS version.

I do hope Atlassian invests some effort into improving Forge TS support and commits to keeping it up to date.

---

<div class="post-metadata">

**Author:** ![LashaniPerera](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LashaniPerera](https://community.developer.atlassian.com/u/LashaniPerera)\
**Post date:** [January 18, 2022, 5:58am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/5 "2022-01-18T05:58:47Z")

</div>

Hi @tbinna,  
Thank you for reaching out. We understood the problem have created a ticket for this issue and will bring it up with the team to check on the prioritisation. Thank you for your patience and understanding.

---

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [January 18, 2022, 7:14am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/6 "2022-01-18T07:14:52Z")

</div>

Thanks, @LashaniPerera. Is this an internal ticket or is there a public issue we can follow?

---

<div class="post-metadata">

**Author:** ![LashaniPerera](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LashaniPerera](https://community.developer.atlassian.com/u/LashaniPerera)\
**Post date:** [January 19, 2022, 12:08am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/7 "2022-01-19T00:08:31Z")

</div>

@tbinna . Please follow [[FRGE-592] - Ecosystem Jira](https://ecosystem.atlassian.net/browse/FRGE-592)

---

<div class="post-metadata">

**Author:** ![LashaniPerera](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LashaniPerera](https://community.developer.atlassian.com/u/LashaniPerera)\
**Post date:** [March 15, 2022, 11:32pm UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/8 "2022-03-15T23:32:41Z")

</div>

@tbinna Would you be able to share the tsconfig\* files in your project or a sample repo where we can reproduce the same issue ?

Forge is trying to use the tsconfig file from ${appDirectory}/tsconfig.json location. There could be a workaround for your issue by renaming the right file.

---

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [March 16, 2022, 3:05am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/9 "2022-03-16T03:05:35Z")

</div>

Hey @LashaniPerera

Thanks for picking this up and having a look. I ran into this issue when I [tried to find a Forge app set up using a monorepo project structure](https://community.developer.atlassian.com/t/forge-monorepo-apps/55813). In this particular case, I tried to used Nx which generated a Typescript project using project references.  
I was considering the renaming approach, however, I do not think this will work because none of the tsconfig files are complete on their own (see my initial post for an example of the base tsconfig file - note that this is the file called `tsconfig.json`). Renaming will likely also not play nicely with the Nx tooling/CLI as it relies on a certain project structure to work.  
Unfortunately, I did not properly keep track of my changes when I tried this out because it was just a first quick test. So I do not have the initial state with project references anymore.

Having said that, to us, it is not super important to solve this specific problem. Instead, we would much prefer if Atlassian would support a Forge project structure that plays nicely with custom UI and Typescript. I have summarized some of our requirements [in the README](https://github.com/toolsplus/forge-turbo#goals) of another attempt we made using Turborepo (unfortunately, we ran into issues there as well).

For us, the ideal situation here would be if Atlassian supports a specific project setup that supports easy building, tunneling, and deployment of Forge custom UI apps using Typescript. Many modern frameworks out there (most prominently Angular) work with a specific project structure which allows them to provide great developer tooling. Additionally, as a developer, it allows me to bootstrap a project within a matter of seconds without having to think of where to put my files, which tooling to use, or scripts to write to build it. I feel, the existing Forge project structure was sufficient for simple sample apps using Forge UI, however, it does not scale well to more complex projects using custom UI and Typescript.

I hope this gives you a better understanding of what we were looking for when we ran into the issue described in this thread.

---

<div class="post-metadata">

**Author:** ![LashaniPerera](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LashaniPerera](https://community.developer.atlassian.com/u/LashaniPerera)\
**Post date:** [March 16, 2022, 5:17am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/10 "2022-03-16T05:17:19Z")

</div>

@tbinna ,  
Thank you for your valuable inputs. I’ll bring this up with the team for further discussions.

---

<div class="post-metadata">

**Author:** ![GerardMarquinaRubio](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@GerardMarquinaRubio](https://community.developer.atlassian.com/u/GerardMarquinaRubio)\
**Post date:** [November 9, 2022, 8:20pm UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/11 "2022-11-09T20:20:44Z")

</div>

Same issue here, I see the ticket is getting stalled. Can we get an update on if this is currently being worked on?

---

<div class="post-metadata">

**Author:** ![ryan.brown](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ryan.brown/32/50800_2.png) [@ryan.brown](https://community.developer.atlassian.com/u/ryan.brown)\
**Post date:** [February 5, 2025, 2:56pm UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/12 "2025-02-05T14:56:38Z")

</div>

I ran into this issue too using a NX monorepo and forge CLI.  
I managed to get it working by slightly changing the setup in my Forge app. By default, NX sets up applications in the repo with 3 tsconfig files:

- tsconfig.app.json - Typescript config for the application code (this is the desired config for use when bundling a forge application).
- tsconfig.spec.json - Typescript config for tests
- tsconfig.json - Whole app Typescript config, incorporating both the app and spec configs.

In my Forge app, I changed this slightly so that the Whole app config was called tsconfig.all.json and the application code’s config is tsconfig.json. This required a small tweak to the root tsconfig that references these to point to the tsconfig.all.json file for the forge application, but after that the monorepo setup worked nicely with the forge CLI.

---

<div class="post-metadata">

**Author:** ![tbinna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/tbinna/32/35870_2.png) [@tbinna](https://community.developer.atlassian.com/u/tbinna)\
**Post date:** [February 19, 2025, 2:31am UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/13 "2025-02-19T02:31:54Z")

</div>

Since this issue is still being discussed, I wanted to provide an update on where we stand with this today.

[We concluded that the Forge CLI should not do Typescript compilation](https://toolsplus.github.io/nx-forge/concepts/motivation#compiled-artifacts). Instead, we compile the TS ourselves and hand JS to the Forge CLI since that’s what’s executed.

To support this process, we built nx-forge to assist with the compilation, packaging and deployment of the Forge apps.

> **[Nx Forge](https://toolsplus.github.io/nx-forge/)**
>
> Efficient and scalable Forge app development

@ryan.brown The above approach solved all the Forge CLI Typescript quirks for us, and we generally work with the generated Nx setup without modifications.

---

<div class="post-metadata">

**Author:** ![andrei-pisklenov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/andrei-pisklenov/32/53500_2.png) [@andrei-pisklenov](https://community.developer.atlassian.com/u/andrei-pisklenov)\
**Post date:** [April 3, 2025, 3:03pm UTC](https://community.developer.atlassian.com/t/is-is-possible-to-specify-the-tsconfig-file-with-the-forge-cli/55111/14 "2025-04-03T15:03:56Z")

</div>

Here’s another option for a smooth start: a Yarn monorepo with TypeScript, a shared package, and many other great features. [https://github.com/andrei-pisklenov/forge-starter](https://github.com/andrei-pisklenov/forge-starter)  
Feedback is always welcome!
