How to disable Javascript Build error in Visual St

2019-01-30 20:55发布

I just updated Visual Studio 2017 from RC to final.
I didn't get the following error but recently I get this error
In building the project, I get the following error and it prevents web project to start:

Severity    Code    Description Project File    Line    Suppression State
Error   eqeqeq  (ESLint) Expected '===' and instead saw '=='.   VistaBest.Shop.Web  C:\***\Request.js   21

JavaScript Error

How can I disable JavaScript building error in Visual Studio 2017?

8条回答
甜甜的少女心
2楼-- · 2019-01-30 20:58

In VS 2017 Enterprise, it should be like this:

enter image description here

查看更多
时光不老,我们不散
3楼-- · 2019-01-30 20:59

If your using latest version of VSCode , try the following steps given in the link Disable ESlint parser error messages - VSCode

查看更多
我想做一个坏孩纸
4楼-- · 2019-01-30 21:05

I've just had to change the "eqeqeq" rule behaviour to include "smart":

Edit the .eslintrc file found in your user root folder mentioned in other answers already.

The change is made to the rules section by adding the smart rule

    "rules": {

    "eqeqeq": [2, "smart"],

Copied from the web article: This option enforces the use of === and !== except for these cases:

  1. Comparing two literal values
  2. Evaluating the value of typeof
  3. Comparing against null

I found the specifics at: https://eslint.org/docs/2.0.0/rules/eqeqeq

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-01-30 21:10

I tried Mohammad's solution but with no luck, I followed Rafeel answer and instead of adding his suggested code sample I removed below code from web .csproj and finally I was able to build and run my project. There were two places where you should remove that in the same file. Still, I don't have any clue how the removed code will affect my solution.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />

Hope this will also help someone to save the day..!!!

查看更多
冷血范
6楼-- · 2019-01-30 21:12

I think, find the solution:

  1. Open Tools > Options
  2. Navigate to Text Editor > JavaScript/TypeScript > EsLint (in VS2017 15.8 it is Linting not EsLint)
  3. Set Enable ESLint to False

Disable ESlint

Visual Studio >= 15.8.5 Disable ESlint Visual Studio 15.8.5

查看更多
beautiful°
7楼-- · 2019-01-30 21:15

Add /*eslint eqeqeq: ["error", "smart"]*/ to the first line of your Javascript code to remove the errors. https://eslint.org/docs/rules/eqeqeq

Following Mohammad's solution will turn off ESLint for syntax checking. This works in VS2015 and should work in later versions.

查看更多
登录 后发表回答