Aurelia development - TS in .js - another rabbit trail

Gah, thought I would clone the aurelia-logging and play with some changes I talked about in another thread, and got sucked down another rabbit trail trying to just make a few simple changes.

So here is where I am at…

I can gulp build the project fine.
But loading up in the editor the src file is .js, uses typescript extensions, and the editor (vscode) is complaining that x can only be used in .ts files.

So change the extension to .ts and now the editor is happy, but of course now you can’t build the project.

How does the Aurelia team have their development environments setup to be able to have TS intermixed in .js files and not get all the lint errors and proper intellisense?

1 Like

Just a guess but it might have something to do with allowJs setting in tsconfig.json
image

1 Like

Thanks, will try that!
Okay, so that allowed me another step forward.

Now there was another conflicting switch in the tsconfig.json:

"declaration": true,

removed that and seems to compile and still create the type file in dist.

1 Like

So I don’t know what changed, but going back to this I can’t get the errors for ‘types can only be used in .ts files’ to go away now in the editor.

As well, the tsconfig.json gives an error about overwriting the input file when using allowJs.

Surely it can’t be this hard to just clone/edit/build an official Aurelia package. I have to have something miss configured somewhere.

1 Like