Integration with JSLint or JSHint

SyntaxEditor for Silverlight Forum

Posted 8 years ago by Kimberley Meyer - Insurity, Inc.
Version: 15.1.0192
Avatar

Is it possible to leverage the validation provided by JSLint or JSHint into the SyntaxEditor? I'm interested in validating user-entered JavaScript to prevent users from not declaring variables with a 'var' statement in order to prevent memory leaks.

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kimberley,

Those libraries are written in JavaScript so you would need some way to execute them from within your Silverlight app.  SyntaxEditor does provide many hooks like the DocumentParseDataChanged event where you could execute such code and update the UI in response to the results.

One thing you might look into is something like this that is a wrapper for JSLint in .NET:

https://visualstudiogallery.msdn.microsoft.com/ede12aa8-0f80-4e6f-b15c-7a8b3499370e

That would certainly make things easier to work with.  You could even wrap our JavaScriptSyntaxLanguage's parser with a custom parser service that would call ours first, and then if there weren't syntax errors, run the JSLint.NET on the code and return any errors it found as part of the parse data results.


Actipro Software Support

The latest build of this product (v18.1 build 0233) was released 4 years ago, which was after the last post in this thread.