These are chat archives for TypeStrong/atom-typescript

May 2015
Nelo Mitranim
May 30 2015 09:37 UTC
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
May 30 2015 09:44 UTC
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
May 30 2015 13:53 UTC
@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
May 30 2015 16:50 UTC
jspm has lots of useful text import plugins.
Nelo Mitranim
May 30 2015 19:19 UTC
@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
May 30 2015 23:36 UTC
@basarat, just in case you haven’t seen yet. The linter project is going to be updating the linter api.