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

Already on GitHub? Sign in to your account

Add a poorrelation option to ignore "Use '{a}' to compare with '{b}'." warnings. #511

Closed
wants to merge 3 commits into
from
View
@@ -214,7 +214,7 @@
moveTo, mootools, multistr, name, navigator, new, newcap, noarg, node, noempty, nomen,
nonew, nonstandard, nud, onbeforeunload, onblur, onerror, onevar, onecase, onfocus,
onload, onresize, onunload, open, openDatabase, openURL, opener, opera, options, outer, param,
- parent, parseFloat, parseInt, passfail, plusplus, predef, print, process, prompt,
+ parent, parseFloat, parseInt, passfail, plusplus, poorrelation, predef, print, process, prompt,
proto, prototype, prototypejs, provides, push, quit, range, raw, reach, reason, regexp,
readFile, readUrl, regexdash, removeEventListener, replace, report, require,
reserved, resizeBy, resizeTo, resolvePath, resumeUpdates, respond, rhino, right,
@@ -303,6 +303,7 @@ var JSHINT = (function () {
onecase : true, // if one case switch statements should be allowed
passfail : true, // if the scan should stop on first error
plusplus : true, // if increment/decrement should not be allowed
+ poorrelation: true, // if poor relations should be allowed
proto : true, // if the `__proto__` property should be allowed
prototypejs : true, // if Prototype and Scriptaculous globals should be
// predefined
@@ -2231,7 +2232,7 @@ loop: for (;;) {
function isPoorRelation(node) {
- return node &&
+ return !option.poorrelation && node &&
((node.type === '(number)' && +node.value === 0) ||
(node.type === '(string)' && node.value === '') ||
(node.type === 'null' && !option.eqnull) ||