0

I'm developing a software using typescript 2.0.3 and tslint 4.0.2 and angular.
I have an issue since my import url is too long for tslint standard. Changing line limit in tslint is not possible in my case.
I tried separate the url to pieces and concatenate them, but it doesn't work. Basically this is what I have:

import {  blabla } from
'./really long string (around 200 characters)';

and this is what I need:

import { blabla } from
'100 characters here' + '100 characters there';

Any suggestions?

Daniel W
  • 1,092
  • 1
  • 12
  • 25

1 Answers1

4

You cannot split the import string. If your path is a/b/very_long_c/blabla, You can create an index.ts inside a/b containing

export * from './very_long_c/blabla';

and use this in your code:

import { blabla } from 'a/b/index';
kdev
  • 705
  • 7
  • 11
  • 1
    You can drop the `index` from the import statement. It will automatically look for `index.ts` if given a directory. – James Monger Feb 12 '17 at 18:04