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

Re: disable jslint validation on a specific function

Expand Messages
  • Douglas Crockford
    ... No. Why do you want to insert crappy code into your code?
    Message 1 of 4 , Sep 16, 2011
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Marcos Zanona" <marcos@...> wrote:

      > Hello I was wondering if it is possible to escape/disable jslint validation for a specific function inside a file like:
      >
      >
      > function off() {
      > /*jslint off*/
      > ...
      > }
      >
      > function on() {
      > //this is jslint enabled
      > ...
      > }
      >
      > I see that this is interesting for development process when you want to embed external code which is not jslint validated within your own code and you don't want to keep getting errors all the time when validating?
      >
      > Is it somehow possible to achieve this currently?

      No. Why do you want to insert crappy code into your code?
    • Marcos Zanona
      Well, let s say you are using some third-party plugin to implement your javascript code interaction with the website. For easier understanding left pick a
      Message 2 of 4 , Sep 17, 2011
      • 0 Attachment
        Well, let's say you are using some third-party plugin to implement your javascript code interaction with the website. For easier understanding left pick a jquery plugin, or that Date extension a developer created and you are willing to test it.

        So as a good habit you won't load each javascript plugin in a separated file, but everything in one single file.

        For testing this Date extension or using that jQuery plugin you certainly won't fix all the errors that person committed when writing it, so you simply want to paste it in your code to see if it works and keep working with it without having jslint accusing those errors, since you would only want to validate your code (even if it's for development stage).

        Then later on you can choose to put those files on the right place, or fixing the errors, etc...

        It is an unfortunate case but we know that most plugins/extensions on web aren't complying with javascript standards. specially when they are minified, hence the idea of disabling that only for these specific cases.

        But this was only a suggestion, in case there's a better solution I would be happy to hear that.

        Thanks
      • Jakob Kruse
        The better solution is to concatenate files in the build phase. Same place you do minification. /Jakob ... [Non-text portions of this message have been
        Message 3 of 4 , Sep 18, 2011
        • 0 Attachment
          The better solution is to concatenate files in the build phase. Same place you do minification.

          /Jakob

          Den 17/09/2011 kl. 18.00 skrev "Marcos Zanona" <marcos@...>:

          > Well, let's say you are using some third-party plugin to implement your javascript code interaction with the website. For easier understanding left pick a jquery plugin, or that Date extension a developer created and you are willing to test it.
          >
          > So as a good habit you won't load each javascript plugin in a separated file, but everything in one single file.
          >
          > For testing this Date extension or using that jQuery plugin you certainly won't fix all the errors that person committed when writing it, so you simply want to paste it in your code to see if it works and keep working with it without having jslint accusing those errors, since you would only want to validate your code (even if it's for development stage).
          >
          > Then later on you can choose to put those files on the right place, or fixing the errors, etc...
          >
          > It is an unfortunate case but we know that most plugins/extensions on web aren't complying with javascript standards. specially when they are minified, hence the idea of disabling that only for these specific cases.
          >
          > But this was only a suggestion, in case there's a better solution I would be happy to hear that.
          >
          > Thanks
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.