TomFuertes TomFuertes -3 years ago 94
Javascript Question

How to suppress "{variable} is better written in dot notation."

Is there an option to and/or how do I suppress errors like the following?


175,14:['tracker'] is better written in dot notation.

Answer Source

If it's a feature and not a bug, place this at the top of your file.

/*jshint sub:true*/

If it's a bug, you should refactor your code

foo['tracker'] = bar // from this...
foo.tracker = bar;   // to this!

Good post on the reasons here: https://stackoverflow.com/a/2001410/94668

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download