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

Importing "this" instead of the export name.

Open DizWARE opened this issue 8 years ago • 1 comments

I can't exactly figure out why this might be happening, but I have a specific export at the end of a file that sets up a logger that looks like this:

const defaultLogger = getLogger("default") as Logger;
export { defaultLogger as logger }

Typescript Importer indexes this export as "this" instead of logger. So, usually on accident I get an import statement at the top of my file that looks like this: import { this } from "relative/path/to/logger/file";

This is what the symbol index file looks like for this export:

"this": [
		{
			"name": "this",
			"path": "path\\to\\logger.ts",
			"isDefault": false
		}
]

It's super annoying, since 'this' is used all the time. Any idea why this would be happening?

Thanks, Tyler Robinson

DizWARE avatar Dec 15 '16 21:12 DizWARE

I will take a look into it, until i have found a fix for this, you can add this file to the excluded files (tsimporter.filesToExclude)

pmneo avatar Dec 17 '16 10:12 pmneo