Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only hint js code inside HTML files #95

Open
danihodovic opened this issue Nov 5, 2014 · 11 comments
Open

Only hint js code inside HTML files #95

danihodovic opened this issue Nov 5, 2014 · 11 comments

Comments

@danihodovic
Copy link

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
Copy link

fetis commented Nov 18, 2014

I got the same problem today. It works fine before

@jarontai
Copy link

jarontai commented Dec 4, 2014

Same problem here.

@victorporof
Copy link
Owner

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
Copy link

fetis commented Dec 8, 2014

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
Copy link
Owner

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

@victorporof victorporof reopened this Dec 8, 2014
@victorporof victorporof changed the title Only hint .js files Only hint js code inside HTML files Dec 8, 2014
@fetis
Copy link

fetis commented Dec 8, 2014

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
Copy link

fetis commented Dec 13, 2014

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
Copy link

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

@nijikokun
Copy link

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

@fetis
Copy link

fetis commented Mar 10, 2015

Unfortunately, I don't have any success with this

@lefoy
Copy link

lefoy commented May 30, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants