-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Description
Bug Report
🔎 Search Terms
- autoImportFileExcludePatterns
Bug
When using the setting typescript.preferences.autoImportFileExcludePatterns
, it works, however, in a mono-repo I cannot import from another package's root without using the full path to the file when excluding index.ts
files.
{
"typescript.preferences.autoImportFileExcludePatterns": [
"./packages/*/src/index.ts"
],
}
I have a workspace package.json
that looks like this:
{
"name": "workspaces",
"version": "1.0.0",
"workspaces": [
"packages/core",
"packages/a"
]
}
In the package.json
of packages/core
I have this:
{
"name": "@org/core",
"main": "./src/index"
}
Then in the packages/a
, I try to import a file from packages/core
, but autoimport imports something like this even though it is exported through the main file:
import { MyClass } from '@org/core/src/classes/my-class';
The package.json
for packages/a
{
"name": "@org/a",
"main": "./src/index"
}
The tsconfig.json
for both:
{
"extends": "../tsconfig.base.json",
"files": [
"./src/index.ts"
]
}
Expected Result
This might be a feature request, but I think it would be great if barrel files could be ignored in the auto-import if within the same module/package, as this can often lead to circular dependencies that are hard to track down.