1

I am working on a JS application that needs to support IE8. To check my source, I am using JSLint. Works fine so far, unfortunately it allows functions like "bind()", which are not supported by IE8.

Is there a way to "tighten up" JSLint, so that it doesn't allow source that wouldn't run in IE8?

Patrick
  • 1,328
  • 10
  • 19
  • I don't have a general answer but for `bind()` specifically you can always add a shim allowing you to use it in IE8: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind (scroll down to the compatibility section) – slebetman Nov 06 '13 at 08:39
  • this question ([jshint “Possible strict violation.” when using `bind`](http://stackoverflow.com/questions/12057427/jshint-possible-strict-violation-when-using-bind)) seems to be closely related. – Praveen Nov 06 '13 at 08:47
  • Here's an interesting library that adds modern JS features to older browsers (includes `bind`): http://augmentjs.com/ – slebetman Nov 06 '13 at 08:47

1 Answers1

2

I'm not sure about JSLint, you can view the available options here.

Using JSHint however, you could use the //jshint es3:true option to

[...] tell JSHint that your code needs to adhere to ECMAScript 3 specification. Use this option if you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments.

as described in the documentation

Moritz Roessler
  • 8,542
  • 26
  • 51