Loading ...
Sorry, an error occurred while loading the content.

2955changing jslint settings inline in a file

Expand Messages
  • firstbakingbook
    Jul 27, 2012
      I see on other forums that people use jslint comments to change the settings for portions of a file, like

      /*jslint something: true */
      something_we_usually_disallow();
      /*jslint something: false */

      Is this expected or supported?

      I'm finding it's very sensitive to where it's placed. For example, this doesn't work:


      /*jslint something: true */
      return something_we_usually_disallow();
      /*jslint something: false */

      jslint complains about an 'unreachable' line after the return statement.

      It also fails in a var declaration, like

      var foo,
      /*jslint something: true */
      bar = something_we_usually_disallow();
      /*jslint something: false */

      where it complains about an unexpected keyword after foo.
    • Show all 2 messages in this topic