jshint

Running JSHint with HTML and getting errors

别等时光非礼了梦想. 提交于 2019-12-11 06:36:19
问题 I'm a newbie to JSHint and trying to run it to validate my Javascript. I have node.js installed and when i try to run JSHint i get the error below. C:\Users\574839\Desktop\testscr.js:1 (function (exports, require, module, __filename, __dirname) { <!DOCTYPE html> ^ SyntaxError: Unexpected token < at Object.exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:513:28) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js

JSLint Weird assignment, required for closure compiler

回眸只為那壹抹淺笑 提交于 2019-12-11 05:29:14
问题 I'm using the closure compiler to minify and speed up my code but I'm running into some issues with JSLint when I try to export my functions. Basically, I have an object, foo{} with a function, foo.bar() that gets called via an external file as. In order for this function to be called externally I need to add some declarations to my script before it gets compiled: window['foo'] = foo; window['foo']['bar'] = foo.bar; This works great, but—as ever—JSLint thinks I'm mental for even attempting

JShint not working

为君一笑 提交于 2019-12-11 02:09:52
问题 I installed jshint using npm install -g jshint. I'm not sure if there is a problem with my node installation or what but when in the terminal and I run jshint it doesn't do anything. It doesn't show anything but a blank line them the next terminal prompt comes up. After a new install of node after having previous troubles after an upgrade when I ran the npm install -g jshint command it didn't look like it ran like it usually does. Here is the output from trying to install jshint. $ npm

Using a config file for JSHint with Rhino

不想你离开。 提交于 2019-12-10 18:25:22
问题 I'm attempting to run jsHint from the command line using Rhino. I want to make the check an automatic part of my teams checkin process. I have the basic configuration working using the command: java -jar .rhino.jar ./jshint.js ./samplefile.js That outputs the standard jsHint messages for my (intentionally error-ridden) sample file. And adding config comments to the top of the sample file works correctly. However I would like to add a project level config file to specify the options I want for

How to disable warnings about 'this' and strict mode using JSHint?

女生的网名这么多〃 提交于 2019-12-10 12:39:58
问题 I am writing a web app using AngularJS (v1.5) so I have some controllers, and in those controllers I am often declaring something like : function myController($someDirectives, ...){ var ctrl = this; // My code } The thing is when I JSHint my code, I get this warning message for all of my 'this' declared in controllers : If a strict mode function is executed using function invocation, its 'this' value will be undefined. I must precise that in my .jshintrc file, I set "strict":false . Does

Enabling JSHint Support for Ext.js in Intellij Idea

折月煮酒 提交于 2019-12-10 11:02:03
问题 So, when i'm using JSHint for my Ext.js project everytime i use Ext it is marked as 'Ext' is not defined by JSHint. How do i suppress this warning or integrate Ext.js into JSHint? I have integrated the Ext sources into my project as an external library and code completion works, so Intellij knows about Ext. SOLUTION: @Nikos answer and the jshint documentation gave me the right direction. I have placed a file called .jshintrc in the root directory of my project. Content: { "predef": [ "Ext",

How do I pass global config to jshint?

我怕爱的太早我们不能终老 提交于 2019-12-10 02:29:12
问题 How do I pass global config to jshint? I didn't find the answer in the documentation. My config file: >type tests\jshint_options.js /*jshint globalstrict:true */ This is what I've tried so far: >jshint myfile.js --config=tests\jshint_options.js myfile.js: line 1, col 1, Use the function form of "use strict". myfile.js: line 4, col 24, Unescaped '['. myfile.js: line 4, col 49, Unescaped '['. 3 errors >jshint myfile.js --config tests\jshint_options.js node.js:201 throw e; // process.nextTick

Cant make gulp-notify to pop up a error message when gulp-jshint fail

落花浮王杯 提交于 2019-12-09 19:43:53
问题 So, was the whole day working on our new FE workflow, the main idea is to run a few tasks through a watcher, we will have our IDE's and a window with the browsers getting refreshed each time something change (scss, js, html, etc). So, we wont see nothing if all went good: the browser will get reload and we will keep working. But, we want to use gulp notify for errors, so in case we have something wrong, the notifier pop up will appear, and at that point, you can check the console and see the

JSHint and eclipse plugin

一世执手 提交于 2019-12-09 17:58:29
问题 So I just installed JSHint in Eclipse Kepler I loaded my .jshintrc file . How do I run jshint on my javascript files? I do not see a menu item nor a place to specify filenames, etc... Can someone help? 回答1: After adding a .jshintrc file to the root of the project you need to: Right-click on your project in the Project Explorer view -> properties -> JSHint -> Configuration -> Check enable. Also select the folders containing your js files (use slashes in the path). I split my js files into two

Sublime Text 3 SublimeLinter plugin not able to find jshint

落爺英雄遲暮 提交于 2019-12-09 15:42:12
问题 For some reason, SublimeLinter3, or the SublimeLinter3 JSHint linter plugin, seems unable to parse the PATH environment variable and is thus unable to run jshint : SublimeLinter: Could not parse shell PATH output: <empty> error: SublimeLinter could not determine your shell PATH. It is unlikely that any linters will work. Please see the troubleshooting guide for info on how to debug PATH problems. SublimeLinter: WARNING: jshint deactivated, cannot locate 'jshint' Can't connect Unable to fetch