user7739271
user7739271

Reputation:

How to disable javascript extensions in Visual Studio 2017?

Screenshot:

enter image description here

I got 4 errors and 2 warnings. With the errors, I don't know where did the rule come from. Since I'd installed VS 2017, I'd installed only 1 extension Web Essentials.

When I click the third error, it refered to Form elements must have labels.

I don't know, I don't know why must it be an error? For html, I want to design whatever I want, not following the rule

Each form element must have a programmatically associated label element.

or blabla.... I don't want any label in there.

My html looks like:

<li class="hidden-sm hidden-xs searchform focus">
    <form action="#" method="post">
        <div class="input-group">
            <span class="input-group-addon">
                <i class="fa fa-search"></i>
            </span>
            <input type="text" class="form-control animated fadeIn" placeholder="Search & Enter">
        </div>
        <input type="submit" value="">
    </form>
</li>

With the first warning. It shouldn't be a warning. Because I would never create a file name hubs and put it in the location signalr/hubs. Of course, it's still working. When I clicked on the first warning code, it refered to

http:/ /www .bing .com/search?q=TS6053+TypeScript+File+not+found.&form=VSHELP (You need at least 10 reputation to post more than 2 links)

So, why do I want to search an error that you know what's the error and how to fix it? A link that how can I fix it rather than searching?

The second warning: I'm not the author for the script, but it looks good. I'm using rangy-core.js plugin.

    selProto.moveToBookmark = function(bookmark) {
        var selRanges = [];
        for (var i = 0, range, rangeBookmark = bookmark.rangeBookmarks[i++]; ;) {
            range = api.createRange(this.win);
            range.moveToBookmark(rangeBookmark);
            selRanges.push(range);
        }

        // error in from here, line 3719
        if (bookmark.backward) {
            this.setSingleRange(selRanges[0], "backward");
        } else {
            this.setRanges(selRanges);
        }
    };

The warning message:

Unreachable code detected.

If I understand right, Unreachable code detected meant:

if (a < b) {
    return smaller;
} else {
    return larger;
}
// Unreachable code detected.
return average;

The code in rangy-core.js looks good, after making a loop, the function can continue checking something.

Totally, all errors and warning are bad for me (in this case). How to disable them?

Upvotes: 1

Views: 1085

Answers (2)

Bowden Kelly
Bowden Kelly

Reputation: 370

The top 4 errors are from an extension in WebEssentials (which is just a pack of extensions) called "Web Accessibility Checker". These errors indicate that the code in your project wouldn't pass online accessibility checks.

You can remove that plugin by going to tools > options > extensions and updates > scrolling down to Web Accessibility Checker > Disable/Uninstall

See image below: Screenshot of disabling web accessibility checker in VS

I strongly recommend you just hide the bottom two, but they are likely bugs. The below code will never return average.

if (a < b) {
    return smaller;
} else {
    return larger;
}
// Unreachable code detected.
return average;

The other one (missing file) will likely be an error at runtime.

Upvotes: 3

joshmcode
joshmcode

Reputation: 3642

Depending on what exactly you are wanting to do, there are a couple of possible options:

Option 1: Disable Error List

You could disable the Error List on build by going to Tools > Options > Project and Solutions > and then unchecking Always Show Error List if build finishes with errors. See this answer here

Option 2: Just hide the errors/warnings

In the error list, if you click the Error or Warning labels, you can toggle displaying them. enter image description here Just click the error box or the warning box and they will toggle off.

Option 3 (bonus: might work, but haven't tested it)

It's possible that if you disable the TypeScript extension by going to Tools > Extensions and Updates and then searching for TypeScript, you will remove those JavaScript specific warnings. But this might also disable your JS Intellisense.

Upvotes: -1

Related Questions