victorporof / Sublime-JSHint

JSHint Gutter for Sublime Text 2 and 3 via node.js
https://github.com/victorporof/Sublime-JSHint
682 stars 71 forks source link

Only hint js code inside HTML files #95

Open danihodovic opened 10 years ago

danihodovic commented 10 years ago

It seems like the Gutter hints all sorts of files, from .txt to .html. I am yet to find a setting for choosing the context for when it is supposed to hint.

fetis commented 10 years ago

I got the same problem today. It works fine before

jarontai commented 9 years ago

Same problem here.

victorporof commented 9 years ago

I can't reproduce this. It should only be linting js or html files that contain javascript. Please post some steps to reproduce, if this is still an issue with the latest version.

fetis commented 9 years ago

Here's my steps to reproduce with Jinja templates,

Create any html file, switch to 'HTML (Jinja2 template) syntax', place in it

{% set var = 1 %}

and validate

This will bring some validation errors, like 'expected a string and instead saw %'

But this will work fine

<div>
    {% set var = 1 %}
</div>

My JSHint Gutter version is 2014.11.20.01.54.34 I'm using Jinja2 Syntax highlighter

victorporof commented 9 years ago

Oh, so this isn't about linting on js files, but linting only js code.

fetis commented 9 years ago

I have suggestion that JSHint enabled for files with source.js, since Jinja templates contains same source it cause validation problems. I have not idea how this can be figured based on file source type (because in Sublime it can be multiple, e.g for *.html they're source.css, source.js, source.html etc).

I think there should be options to exclude some file types from validation. But I'm not very familiar with Sublime and JSHint

fetis commented 9 years ago

I think this can be figured out by this issue

59 .jshintignore not being honored

when it'll be resolved of course :)

maybe I'll try to make a patch

theronpatrick commented 9 years ago

@fetis Any luck with a patch? I've run into the same issue as you using Handlebars .html templates.

nijikokun commented 9 years ago

Any update on the situation @fetis? Have the same issue unfortunately...

fetis commented 9 years ago

Unfortunately, I don't have any success with this

lefoy commented 8 years ago

I also have this issue, I guess it's just abandoned?