Architecture constraints and TypeScript project references

I tried to activate the new architecture constraints. The project is analyzed in SonarQube Cloud, Team plan, with unmodified SonarWay profile.

We use a repository with many TypeScript projects, referring each other through TypeScript project references. In the code we import using Node module names. We do not import other projects as files.

Example:

import { Interface } from '@myProject/baseModule';

and in tsconfig.json:

...
  "references": [
    {
      "path": "../base/module"
    },
...

I wasn’t able to create an error with SonarQube configuration like this, which is wrong on purpose to provoke an error:

{
    "constraints": [
        {
            "to": ["base/**/*.ts"],
            "from": ["app/**/*.ts"],
            "relation": "deny"
        }
    ]
}

Is this scenario not yet supported?

Hello Christian,

Thank you for the feedback! Indeed, I have reproduced a project with imports based on TS project references and the dependency isn’t getting resolved.

I have opened a ticket internally to track this issue.

Is there any update one this?

Hi,

That ticket is still open.

 
HTH,
Ann

Hi Christian,

Earlier this year we shifted our priorities and deprecated the capability, which will be removed in this month’s releases on Server and Cloud, to be replaced by the Intended architecture capability of SQ Architecture, now in beta. You can sign up for the beta here.

You can expect SQ Architecture to evolve quickly in the coming months, see the blog post announcing availability.

Thanks!