Can you put an ASP.NET TODO preprocessor or tag in aspx source JavaScript?

I would like to connect this so as not to forget to remove it if I do not use it or do not need it. ReSharper will not pick it up because it is JavaScript. Even the Visual Studio 2008 task list will not clear comments.

My thoughts were either a directive //TODO:or #warning, but so far I can’t find anything that works and gives no errors.

An example of an attempt:

<script type="text/javascript">
    //ClientSide validation
    function CheckRootCause(sender, args) {

    //TODO: remove this if not needed
    <% #warning "unused code" %>
        var iValue = parseInt(args.Value);
        args.IsValid = iValue > 0;

    }
</script>

TODO is not matched by the Visual Studio task list, <% #warning %>it gives 3 warnings instead of 1. The warning itself, a warning about the expected expression, and an invalid warning. It also gives 3 ReSharper underscores when I look at the code, including red, as if it were a compilation error.

-,

  • Visual Studio
  • Visual Studio ErrorList
  • Visual Studio , Obsolete
  • ReSharper todo

, .

-?

+3
1

#warning. , :


<% 
    #warning "unused code" 
    //TODO: remove this if not needed
%>
<script type="text/javascript">
    //ClientSide validation
    function CheckRootCause(sender, args) {
        var iValue = parseInt(args.Value);
        args.IsValid = iValue > 0;

    }
</script>

, "" , <script> .

+3

Source: https://habr.com/ru/post/1720704/


All Articles