fgnass / jshint.tmbundle Goto Github PK
View Code? Open in Web Editor NEWJSHint TextMate Bundle
JSHint TextMate Bundle
Depending upon the project I'm working on, there may be different rules. The bundle should give priority to the inline configuration of the file.
/*jshint asi: true, curly: false */
var stuff = 'whatever'
// etc.
I'm running the latest nightly build of TM2 (9300), and whenever I save a js file with this bundle enabled, Textmate crashes. Specifically, the window shrinks to 1/2 the screen, it shows some results, then if I click on the window again, it closes.
Not sure if this is JsHint specific or a general bug in Textmate, but I haven't seen it happen with other bundles.
Hi,
When I execute Save & Hint I get the following error:
module.js:340
throw err;
^
Error: Cannot find module '../data/ascii-identifier-data.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/tito/Library/Application Support/Avian/Pristine Copy/Bundles/jshint.tmbundle/Support/lex.js:12:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I have verified that PATH looks like this:
$PATH:/opt/local/bin:/usr/local/bin:/usr/texbin
Node is also setup properly:
Alpha:test_app tito$ which node
/usr/local/bin/node
Alpha:test_app tito$
Any idea why it's not working? Thanks!
I'm running TextMate version 2.0-alpha.9475
on OSX 10.8.5 and my node is installed with brew in
[rails 3] which node
/usr/local/bin/node
[rails 3] ls -la /usr/local/bin/node
lrwxr-xr-x 1 walther admin 31 9 Sep 17:29 /usr/local/bin/node -> ../Cellar/node/0.10.13/bin/node
and I even tried making the node
[rails 3] ln -s /usr/local/Cellar/node/0.10.13/bin/node node
My PATH in TextMate is $PATH:/opt/local/bin:/usr/local/bin:/usr/texbin
and yet, when I do a CMD-S JsHint complains with
Failure running Save & Hint
env: node no such file or directory
any leads, hints, links would make my day <:)
looks like you jshint url is wrong, should be hitting: /jshint/jshint/master/src/stable/jshint.js
Have downloaded & installed node.js, and passed a JS file I know to have errors, but nothing happens
Would be cool to be able to select the individual error messages with a keyboard, press enter and jump directly to the position in the code.
Failure running “Save & Hint”.
module.js:340
throw err;
^
Error: Cannot find module './parser.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/Users/jm019641/Library/Application Support/Avian/Pristine Copy/Bundles/jshint.tmbundle/Support/jshint.js:4:14)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
I've made a separare pull request #14 that updates the url for where jshint.js is downloaded and I'm working on adding the ability to run jshint on unsaved content in a document.
The project I am working on builds and tests after file saves and I often want to be able to run jshint on the content in the current doc before I have saved it.
In a local branch I've added a Hint command which is just a simple variation of the Hint and Save command. This works ... but it only checks content that has already been saved.
I looked through other bundles that do something similar and noticed that the HTML bundle will show previews of new document content that is not already saved. I posted this question on their issue tracker: how does the html bundle preview a document with unsaved changes?
It seems like for this to work they'd need to make a temporary file ... but I'm not sure how they are doing that.
I'm noticing two differences in the HTML Show Web Preview command.
cat
In jshint_tm.js
you are streaming to console (stdout) and then exiting with status 205:
process.exit(205); //show_html
https://github.com/fgnass/jshint.tmbundle/blob/master/Support/jshint-tm.js#L94-L99
I don't know exactly how/where the exit status 205 results in a show_html operation. I've looked in the textmate source and not found something that looks for this process exit status and generates an html view. Is this part of textmate or something in the OS?
I think the simplest way to get Hint (without saving) working is to:
env.TM_FILEPATH
jshint-tm.js
invocation.Version: 2.0 (8930).
Bundle installed in Application/Textmate/Contents/SharedSupport/Bundles.
The TextMate window is resized instead of display the result dialog.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.