I have a new project where I am incorporating TypeScript, but for some reason the auto import feature is not working as expected. Below you can find my file structure, tsconfig file, and an example:
tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"pretty": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": true,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"outDir": "../Js/",
"baseUrl": "./",
},
"include":[
"*.ts"
],
"compileOnSave": true
}
File Structure
https://i.sstatic.net/ggRjpm.png
Expected Import Suggestion in App.ts
https://i.sstatic.net/NuJN3.png
I am anticipating an import suggestion for ImageRowsInitializer
from the file named images-row.ts
.
images-row.ts
export class ImageRowsInitializer {
private image_rows : ImagesRow[];
constructor() {
const htmlImageRows = document.getElementsByClassName("row-container");
for (let i = 0; i < htmlImageRows.length; i++) {
const imagerow = htmlImageRows[i];
this.image_rows.push(new ImagesRow(imagerow as HTMLElement));
}
}
}
I am puzzled why the suggestions are not showing up...
Please inform me if more details are required, I would be glad to provide them :)