Integration with JSLint or JSHint

SyntaxEditor for Silverlight Forum

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

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 7 years ago by Actipro Software Support - Cleveland, OH, USA

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:

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 (v2018.1 build 0233) was released 3 years ago, which was after the last post in this thread.