Search code examples
javascriptc#visual-studiovisual-studio-2022

How to disable JavaScript warnings in a .NET C# project in Visual Studio?


I have a .NET 7 Web MVC project. Visual Studio 2022 shows me JavaScript warnings, mostly from various libraries that live under wwwroot/lib. There is little I can do about these warnings since I don't want to mess with existing libraries.

How can I get rid of them (other than manually adding specific numbered NOWARN entries to the csproj)?

enter image description here


Solution

  • You can try: go to Tools > Options… and search for ESLint:

    Uncheck the checkbox in front of Enable ESLint, restart Visual Studio, and you are done.

    If the errors persist, you can open Tools > Options… again, search for JavaScript Errors and disable the setting:

    Restart again, and now Visual Studio will no longer show you any JavaScript errors.