How to make atom-typescript recognize modules without a relative path?

I am following an angular meter using angular2 and typescript .

Since I use atom, I added the atom-typescript package and file tsconfigto use type declaration files.

I am trying to make atom- typescript recognize an import on client/parties-form/parties_form.ts:

import {Parties} from  'collections/parties';

But the atom gives me the following error: Cannot find module 'collections/parties'.

Error when I import a module with a relative path:

import {Parties} from '../../collections/parties';

But then the meteorite will not compile and give me an error Path reservation conflict.

I would like to be able to use the first type of import without atom-typescript, giving me some kind of error and, therefore, recognizing type declaration files. What did I miss?

My tsconfig.jsonfile:

{
    "version": "1.5.0",
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "noLib": false,
        "emitDecoratorMetadata": true
    },
    "filesGlob": [
        "./**/*.ts",
        "!./typings/**/*.ts"
    ]
}

.

+4
1

import {Parties} from '../../collections/parties';

typescript. node_modules TypeScript. : https://github.com/Microsoft/TypeScript/issues/5039

+2

Source: https://habr.com/ru/post/1617790/


All Articles