ts-importer icon indicating copy to clipboard operation
ts-importer copied to clipboard

Importing from node_modules/@types is broken

Open iyegoroff opened this issue 7 years ago • 7 comments

If tsimporter.preferRelative is true import statement is not being added automatically when selecting symbol from drop-down menu.

iyegoroff avatar Mar 20 '17 11:03 iyegoroff

Please take a look into the dev console for any error outputs and paste in here.

pmneo avatar Mar 20 '17 11:03 pmneo

file: 'file:///Users/iyegoroff/Documents/dev/js/ts-test/test.ts' severity: 'Error' message: 'Cannot find name 'Component'.' at: '1,1' source: 'ts'

iyegoroff avatar Mar 20 '17 11:03 iyegoroff

Please provide a sample project.

pmneo avatar Mar 21 '17 11:03 pmneo

https://github.com/iyegoroff/ts-importer-bug

Autoimporting works only for Something symbol, but not for Component.

ts-importer symbols

{
	"knownSymbols": {
		"Component": [
			{
				"name": "Component",
				"module": "react",
				"isDefault": false
			}
		],
		"Something": [
			{
				"name": "Something",
				"path": "/Users/iyegoroff/Documents/dev/js/ts-test/temp.ts",
				"type": "const",
				"isDefault": false
			}
		]
	}
}

iyegoroff avatar Mar 21 '17 11:03 iyegoroff

This is currently not implemented. See Todo section:

Follow up /// declarations Process node_modules//*.d.ts Process typings//*.d.ts

Those can just be imported if a import statement exists in any ts file

pmneo avatar Mar 21 '17 14:03 pmneo

So have this is implemented now?

k8w avatar Aug 23 '17 12:08 k8w

No ... This is hard work to do, because of the wildcard export feature like export * from './zone'; which may be nested too.

pmneo avatar Sep 25 '17 05:09 pmneo