admin管理员组文章数量:1133971
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 the 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
How can I disable JavaScript building error in Visual Studio 2017?
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 the 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
How can I disable JavaScript building error in Visual Studio 2017?
Share Improve this question edited Apr 7, 2019 at 17:48 Sebastian Simon 19.5k8 gold badges60 silver badges84 bronze badges asked Mar 10, 2017 at 17:55 Mohammad DayyanMohammad Dayyan 22.4k44 gold badges170 silver badges241 bronze badges 7 | Show 2 more comments7 Answers
Reset to default 297I think, find the solution:
- Open
Tools > Options
- Navigate to
Text Editor > JavaScript/TypeScript > EsLint
(in VS2017 15.8 it isLinting
notEsLint
) - Set
Enable ESLint
toFalse
Visual Studio >= 15.8.5
In Visual Studio 2017 (v 15.8.0):
Option 1: Options > JS Errors
- Open
Tools > Options
- Navigate to
Text Editor > JavaScript/TypeScript > Code Validation
- Set
Enable JavaScript errors
tofalse
- or, set
Enable JavaScript errors
totrue
andShow errors as warnings
totrue
I needed to restart Visual Studio for this to take effect.
Option 2: Options > Linting
There is another option below which will let you edit your global linting settings:
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
- ESLint file syntax
- ESLint Rules
I tried Mohammad`s solution but it didn't work. I managed to work doing the following:
- Righ click on your web .csproj file
- On the first
<PropertyGroup>
add the following entry:<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
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.
For Visual Studio 2019.
- Open Tools > Options
- Navigate to Text Editor > JavaScript/TypeScript
- => Linting > General.
Then unchecked ESLint check box. Please The bellow Image for reference.
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:
- Comparing two literal values
- Evaluating the value of typeof
- Comparing against null
I found the specifics at: https://eslint.org/docs/2.0.0/rules/eqeqeq
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..!!!
本文标签: How to disable JavaScript build error in Visual Studio 2017Stack Overflow
版权声明:本文标题:How to disable JavaScript build error in Visual Studio 2017? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736772905a1952183.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
==
is as valid a comparison operator as '==='. For me it doesn't prevent me from building, it just clutters up the error list when I have another error in my server code. – xr280xr Commented Sep 27, 2017 at 21:09