pushqrdx / vscode-inline-html

🎨 Adding Syntax Highlighting, Emmet, IntelliSense support for ES6 Template Strings in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=pushqrdx.inline-html
GNU General Public License v3.0
54 stars 15 forks source link

html is not defined #10

Closed Seanmclem closed 4 years ago

Seanmclem commented 5 years ago

when doing html`markup` when running my code I get errors because of the apparent random reference to "html"

I had to use

/*html*/`markup`

and that worked, but it'd be nice if I could get the other method to work. I'm using the string in an assignment directly to a template element's innerHTML, similar to the template-literal seen here on a repo of mine.

pushqrdx commented 5 years ago

@Seankps the html method isn't random and isn't a dependency of this extension either. it's what Polymer, lit-html and lit-element use to define web components markup. Hence you import html from them. I added the ability to use /*html*/ and /*css*/ for folks who dont use the aforementioned frameworks so feel free to use that.

mmospanenko commented 5 years ago

Prettier doesn't format inline template if I use template: /*html*/ but it works with template: html where 'html' is not defined.eslint(no-undef). So I think /*html*/ have to work the same as html syntax.

pushqrdx commented 5 years ago

@mmospanenko I am pretty sure this is related to Prettier itself not recognizing the /*html*/ syntax, as i don't have any control over how Prettier or any other formatter behaves.