Unwanted aliasing/importing when navigating chained imports

I'm chaining imports and exports through a tree of files to emulate namespaces, using the approach from here: https://stackoverflow.com/a/37919727/681538

Example:

import * as Site from "./ns_Site";

var test = Site.Common.HandleIssue.Navigation.Test();
var test2 = Site.Common.Common.Test2();
var test3 = new Site.Common.Common.Modules.TestModule();

This works fine, but when I'm traversing the "namespace" R# keeps redefining aliases, even though I have checked "Prefer qualifying instead of adding module aliases" in Options > Code Style.

When I write "Site.Common.HandleIssue.Navigation.Test()" having R# enabled, it adds two imports: 

import * as Site from "./ns_Site";
import * as NsCommon from "./Site/ns_Common";
import * as NsHandleIssue from "./Site/Common/ns_HandleIssue";

var test4 = NsHandleIssue.Navigation.Test();

How do I disable this? I thought "Prefer qualifying instead of adding module aliases" meant just this.

 

0

Please sign in to leave a comment.