jshint

Adobe Brackets disable jslint but allow jshint

大兔子大兔子 提交于 2019-12-02 16:59:55
My basic question: In the Adobe Brackets editor how do I use jshint while turning off or disabling jslint? My tl;dr: When linting javascript in the Adobe Brackets editor I find that I get results for both jslint and jshint. While I have jshint configured to my liking I can never avoid the warning symbol that appears indicating I have failed to pass jslint so it always looks like there are problems with my linting. I only want to use jshint as the ability to globally configure it via the .jshintrc file is quite useful but I don't see a way to turn off jslint and still permit jshint. Anyone know

How to fix '$' was used before it was defined in both jslint and jshint using coding?

浪子不回头ぞ 提交于 2019-12-02 15:40:51
问题 I am using jQUery . And in jslint , I keep on '$' was used before it was defined. or document was used before it was defined. I know I can stop those from showing up by using /*jslint browser: true*/ /*global $, jQuery*/ But I wanted to actually fix this through coding if possible. So, I did like before. var $, document; $(document).ready(function () { "use strict"; However, now it says Two warnings 1 Redefinition of '$'. 1 Redefinition of 'document'. in jshint . Is there a coding that I can

Getting Facebook's react.js library JSX syntax to play nicely with jslint?

别等时光非礼了梦想. 提交于 2019-12-02 14:29:42
I am playing around with the Facebook's react.js library. I am trying to use their JSX syntax which describes creating a view in the following way. /** @jsx React.DOM */ var HelloMessage = React.createClass({ render: function() { return <div>{'Hello ' + this.props.name}</div>; } }); React.renderComponent(<HelloMessage name="John" />, mountNode); JSLint obviously does not like this ("expected an identifier and instead saw ' <';" - JavaScript syntax error), so how do I get around this in my .jshintrc file? (update: this post is from 2013 and obsolete now) I use JSHint + JSX. It shouldn't require

JsHint warning: A regular expression literal can be confused with '/='

随声附和 提交于 2019-12-02 11:44:44
问题 I have this line in my Javascript code: var regex = /===Hello===\n/; JsHint gives me a warning in this line: A regular expression literal can be confused with '/='` ...but I don't know what's wrong with this regular expression? How can I avoid this warning? 回答1: The problem is that /= could be interpreted as a division and assignment, rather than the start of a regular expression literal. You can avoid the warning by using the RegExp constructor instead: var regex = new RegExp("===Hello===\n"

How to fix '$' was used before it was defined in both jslint and jshint using coding?

…衆ロ難τιáo~ 提交于 2019-12-02 09:29:50
I am using jQUery . And in jslint , I keep on '$' was used before it was defined. or document was used before it was defined. I know I can stop those from showing up by using /*jslint browser: true*/ /*global $, jQuery*/ But I wanted to actually fix this through coding if possible. So, I did like before. var $, document; $(document).ready(function () { "use strict"; However, now it says Two warnings 1 Redefinition of '$'. 1 Redefinition of 'document'. in jshint . Is there a coding that I can use to please both jshint and jslint ? Please use jslint comments. The following suggestion uses a few

jshint and sublimelinter settings config on mac

随声附和 提交于 2019-12-01 11:28:27
I'm trying to configure sublimelinter, specifically jshint on my Mac. On my windows version of SublimeText there is the following section in SublimeLinter.sublime-settings "jshint_options": { // To fix column positions for JSHint errors you may want to add `"indent": 1` to your // **User** "jshint_options". This issue affects users with tabs for indentation. // This fix was reverted due to a conflict with using the `"white": true` option. // "indent": 1, "evil": true, "regexdash": true, "browser": true, "wsh": true, "trailing": true, "sub": true }, When I view the file on my Mac this section

jshint and sublimelinter settings config on mac

不羁的心 提交于 2019-12-01 09:45:44
问题 I'm trying to configure sublimelinter, specifically jshint on my Mac. On my windows version of SublimeText there is the following section in SublimeLinter.sublime-settings "jshint_options": { // To fix column positions for JSHint errors you may want to add `"indent": 1` to your // **User** "jshint_options". This issue affects users with tabs for indentation. // This fix was reverted due to a conflict with using the `"white": true` option. // "indent": 1, "evil": true, "regexdash": true,

JsHint - Hide This Message: ES5 option is now set per default

时间秒杀一切 提交于 2019-12-01 04:33:56
I'm using gulp-jshint, and the following error message is annoying: ES5 option is now set per default How can I remove it? It's just telling you that it is the default so you don't need to add it as an option. Look in the .jshintrc file and remove "es5": true . http://jslinterrors.com/es5-option-is-now-set-per-default For me it was line: "esversion" : 5, in .jshintrc . When I commented it problem disappeared. 来源: https://stackoverflow.com/questions/24212156/jshint-hide-this-message-es5-option-is-now-set-per-default

JsHint - Hide This Message: ES5 option is now set per default

佐手、 提交于 2019-12-01 02:10:55
问题 I'm using gulp-jshint, and the following error message is annoying: ES5 option is now set per default How can I remove it? 回答1: It's just telling you that it is the default so you don't need to add it as an option. Look in the .jshintrc file and remove "es5": true . http://jslinterrors.com/es5-option-is-now-set-per-default 回答2: For me it was line: "esversion" : 5, in .jshintrc . When I commented it problem disappeared. 来源: https://stackoverflow.com/questions/24212156/jshint-hide-this-message

difference between globals and predef in .jshintrc?

人盡茶涼 提交于 2019-12-01 02:09:28
What the difference and purpose of having both of them in the .jshintrc? When I want to add a variable to be ignored, which one is the best one I should use? Also I can't find 'predef' in http://www.jshint.com/docs/options/ rekarnar It seems like predef is deprecated and you should use globals instead. More information here At JSHint Doc page http://www.jshint.com/docs/ "predef" is mention for use inside .jshintrc file, wile word "globals" is used only once for inline directive (those that are inside .js files) So examples would be : inside .jshintrc file "predef" : [ // Extra globals "angular