JSLint.NET not appearing in VS2013

Coordinator
Nov 16, 2013 at 11:19 PM
From discussion by H28669 on the Visual Studio Gallery:
I have installed JSLint on VS2013, but it does not show the context menu in source code editor, nor the JSLint Options menu item under Tools menu.

In VS2012 it worked fine.
Coordinator
Nov 16, 2013 at 11:29 PM
Edited Nov 16, 2013 at 11:31 PM
Here are some questions that should help figure out the problem:
  • How did you install it? From the "Extensions and Updates" dialog inside Visual Studio? Or from a downloaded VSIX?
  • Does "JSLint.NET for Visual Studio" appear in the list of plugins in the "About Microsoft Visual Studio" dialog?
P.S. JSLint.NET does not have an item in the "Tools" menu. You may be thinking of JSLint4VS. In some ways JSLint.NET is a successor to that project, but they're not the same. This is what JSLint.NET menu items look like:
Settings
Nov 21, 2013 at 12:27 PM
Hi Qube

Thanks for hint. In fact I was looking at places context menu appeared in JSLint4VS.
  1. In options menu there are three-state checkboxes. What is the 3rd state for? I have observed that for 3rd state there will
    be no entry in json file. What is the default value for an option?
  2. What is the reason that "Run JSLint" menu item was removed from context menu in source file editor?
    I found it very practical to quickly execute JSLint on the file I was currently editing.
    Is there a way to add button that applies only to current file?
Thanks again for help.
BR, Gianni
Nov 21, 2013 at 12:33 PM
Hi Qube

Actually I just realized that the context menu contains entry "Run JSLint" for files with extension .js
I was checking on a file with extension .html that contains JavaScript.

BR, Gianni
Nov 21, 2013 at 2:11 PM
Hi Qube

Is there a way to run JSLint on a html page that contains JavaScript from within HTML source code editor?
I have tried to define a global keyboard shortcut that calls command EditorContextMenus.CodeWindow.RunJSLint
It works fine for js files, but not for html files.
Coordinator
Nov 21, 2013 at 7:44 PM
Good questions. I'll answer them best I can:
  1. The tri-state checkboxes mimic the form on JSLint.com as closely as possible within the constraints of WPF. The three states are true, false and "not set" (the default) which translates to undefined. JSLint currently interprets these undefined values as false, but that could change. If it is "not set" we do not store a value at all in JSLintNet.json. In other words, we make no assumption about what the default value should be - that's JSLint's job.
  2. HTML and CSS parsing have been removed from JSLint for some time. Here is Crockfords reasoning on the matter:
    http://tech.groups.yahoo.com/group/jslint_com/message/3170
    And here is a related issue:
    Unexpected backslash in CSS content
    The best suggestion I can make is to move inline scripts embedded in HTML to their own .js files; that really is best practice. If that simply isn't possible, it may be possible to implement a "Run JSLint on selection" feature, which would allow you to highlight the body of the script and lint it. If that sounds good, add an issue and I'll see how popular it is.