My aspx file has the following code:
<script type="text/javascript">
var doClientSearch =
{
title: `Client Search`
}
$(document).ready(function ()
{
setup();
});
</script>
In Visual Studio 20120, I use auto format which produces:
<script type="text/javascript">
var doClientSearch =
{
title: `Client Search`
}
$(document).ready(function ()
{
setup();
});
...
</script>
The remaining script is also indented. It appears all functions after the incorrect indention use that incorrect indention as a “left” gutter. I have been through all of the formatting options and cannot seem to find a way to resolve this issue. Many members of our development team do not indent code correctly (some do not indent at all!) and this code is extremely difficult to read and takes time to properly format without VS Format Document command.
I also welcome other strategies for proper code formatting.
The var statement should be closed with a ;
I suspect that the indentation will work correctly if you close your var statement. For this particular use case, it still requires that your development team create somewhat semantically correct javascript code. Perhaps beating your dev team more frequently will do the trick. 🙂