
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.
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.
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.