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条回答
Melony?
2楼-- · 2019-01-30 21:18

I tried Mohammad`s solution but it didn't work. I managed to work doing the following:

  1. Righ click on your web .csproj file
  2. On the first <PropertyGroup> add the following entry: <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
查看更多
仙女界的扛把子
3楼-- · 2019-01-30 21:21

In Visual Studio 2017 (v 15.8.0):

Option 1: Options > JS Errors

  1. Open Tools > Options
  2. Navigate to Text Editor > JavaScript/TypeScript > Code Validation
  3. Set Enable JavaScript errors to false
  4. or, set Enable JavaScript errors to true and Show errors as warnings to true

I needed to restart Visual Studio for this to take effect.

Options > JS Errors

Option 2: Options > Linting

There is another option below which will let you edit your global linting settings:

Options > JS Linting

Option 3: .eslint file

You can also create a file named .eslintrc in the root of your project.

Option 4: ESLint commands in-file

See @user9153924's answer


Resources

查看更多
登录 后发表回答