These are chat archives for TypeStrong/atom-typescript

30th
May 2015
Nelo Mitranim
@Mitranim
May 30 2015 09:37
Trying to solve a problem with TypeScript and jspm imports, maybe someone has an idea. I'm at the end of my wit
jspm plugins allow you to import .html files as text, like this:
import template from './mock-component.html!text';
It's super useful with UI components like in Angular or in one little library I'm building, and it works with jspm bundling (the html files are included into the bundle as JS strings and imported normally)
The problem is that TypeScript complains about these things and I have no idea how to silence this
Maybe someone has a clue?
Nelo Mitranim
@Mitranim
May 30 2015 09:44
Aha so turns out you can use this by manually declaring a module with an absolute path like mock-component/mock-component.html!text and importing using the same path, but this is so fiddly
Too bad TS doesn't have a gitter :D
Micah Zoltu
@MicahZoltu
May 30 2015 13:53
@Mitranim What are you doing with template? In your JS are you referring to it in some way? (not: I am not familiar with text import plugin)
Jonathan Park
@park9140
May 30 2015 16:50
jspm has lots of useful text import plugins.
Nelo Mitranim
@Mitranim
May 30 2015 19:19
@Zoltu I'm passing it to a UI framework as a string for compilation, akin to how you can pass string templates to angular
Anyway nevermind I just wrote a custom gulp html2js plugin to preprocess views....
Importing with jspm using relative paths would be best but TypeScript can't be shut up about them
Jonathan Park
@park9140
May 30 2015 23:36
@basarat, just in case you haven’t seen yet. The linter project is going to be updating the linter api.