Description
Bug Report
π Search Terms
prevent suggest autocomplete import path out dist build exclude filter only π€·ββοΈ
#35395 is the closest related issue, but it hasn't seen much progress. I'm filing this new issue per:
As a general rule, if auto-imports is doing something that objectively makes no sense, please file a new issue instead of commenting on this one for better visibility. This thread is about excluding things that we really have no way of knowing to exclude without the user telling us explicitly, like #35395 (comment). Thanks!
π Version & Regression Information
Has been a bug as long as I can remember. π’
β― Repro
git clone https://github.com/cubing/cubing.js && cd cubing.js
git checkout 0314f2789a796ff57d40b567cc674baf5c1a6cc7
npm install && make build # Populate `dist` dir
code . ./src/sites/experiments.cubing.net/cubing.js/stub/index.ts
Then wait for TS to initialize and type new TwistyPlayer
to get an import suggestion.
(I'm sorry, I've had trouble creating a smaller repro. But those shell commands should reliably create a repro state.)
π Actual behavior
The top import suggestion is TwistyPlayer
from ../../../../../dist/types/twisty
, ahead of ../../../../cubing/twisty
.
π Expected behavior
The top (and only exact string match) import suggestion is for TwistyPlayer
from ../../../../cubing/twisty
.
The compiler options in tsconfig.json
include "outDir": "./dist"
. I've spent quite some time trying to tweak the outDir
, rootDir
, include
, exclude
, fields in package.json
, etc. Nothing seems to change the fact that dist
is prioritized for the import suggestion. Given that the out dir is the output for my source code, I never want to import it in my source code. I find the current behaviour surprising, and have not been able to work around it after multiple attempts of several hours each. π
Any workarounds or TypeScript features to prevent dist
from showing up would be appreciated!