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

Use JsHint's extract method to lint inline JavaScript, instead of our home-backed regexes #84

Open
MaKleSoft opened this issue Jul 31, 2014 · 2 comments

Comments

@MaKleSoft
Copy link

Linting inline JavaScript in HTML files does not seem to work for me in SublimeText 2. I noticed that you are extracting the JavaScript 'manually'. Why not use the functionality provided by jshint itself?

var extract = require('jshint/src/cli').extract;
var js = extract(html, 'auto');

See http://www.jshint.com/docs/cli/

@victorporof
Copy link
Owner

When I initially wrote this plugin, jshint didn't have that functionality IIRC. I'd be more than happy if we switched over to the new implementation.

@victorporof
Copy link
Owner

Linting JS inside HTML should work properly now. It'd still be nice to switch to jshint's extract method. At the moment, js is regexed out of the markup.

Fixed by 5a24960

Relevant code that wasn't used anymore: https://github.com/victorporof/Sublime-JSHint/blob/master/scripts/run.js#L67

@victorporof victorporof reopened this Oct 27, 2014
@victorporof victorporof changed the title Inline JavaScript linting not working Use JsHint's extract method to lint inline JavaScript Oct 27, 2014
@victorporof victorporof changed the title Use JsHint's extract method to lint inline JavaScript Use JsHint's extract method to lint inline JavaScript, instead of our home-backed regexes Dec 7, 2014
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

2 participants