In an ASP.NET MVC 5 project using binding and minimization, I have a Javascript view model that I populate in a .cshtml file. The view model refers to a knockout via ko , which works just fine. However, the JsHint output that comes from Web Essentials reports W117 warnings, 'ko' is not defined for every link to ko .
The .js files are as follows:
function MyViewModel(viewModel) { self.someValue = ko.observable();
The .cshtml files are as follows:
... @section Scripts { <script> ko.applyBindings(new MyViewModel(ko.mapping.fromJS(@Html.Raw(Json.Encode(Model))))); </script> }
How can I keep the benefits of "undefined" warnings at all, but avoid these false warnings?
jshint visual-studio-2013 web-essentials
Edward brey
source share