I'm following angular-meteor tutorial using angular2 and typescript.
Since I'm using atom, I added atom-typescript package and a tsconfig
file to take advantage of type declaration files.
I'm trying to make atom-typescript recognize the import on client/parties-form/parties_form.ts
:
import {Parties} from 'collections/parties';
But atom give me the following error : Cannot find module 'collections/parties'.
Error goes off when I import the module with relative path :
import {Parties} from '../../collections/parties';
But then meteor wont compile and gives me a Path reservation conflict
error.
I'd like to be able to use the first kind of import without atom-typescript giving me any error and hence recognizing my type declaration files. What did I miss ?
My tsconfig.json
file :
{
"version": "1.5.0",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true
},
"filesGlob": [
"./**/*.ts",
"!./typings/**/*.ts"
]
}
Full version of the tutorial code can be found here.
import {Parties} from '../../collections/parties';
This requirement is not specific to atom-typescript. Non relative paths for your own code outside node_modules is not supported in TypeScript. Track this issue for details : https://github.com/Microsoft/TypeScript/issues/5039
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With