Reputation: 22458
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?
Upvotes: 162
Views: 55942
Reputation: 61
For Visual Studio 2019.
Then unchecked ESLint check box. Please The bellow Image for reference.
Upvotes: 4
Reputation: 53
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:
I found the specifics at: https://eslint.org/docs/2.0.0/rules/eqeqeq
Upvotes: 3
Reputation: 22458
I think, find the solution:
Tools > Options
Text Editor > JavaScript/TypeScript > EsLint
(in VS2017 15.8 it is Linting
not EsLint
)Enable ESLint
to False
Upvotes: 297
Reputation: 15577
Tools > Options
Text Editor > JavaScript/TypeScript > Code Validation
Enable JavaScript errors
to false
Enable JavaScript errors
to true
and Show errors as warnings
to true
I needed to restart Visual Studio for this to take effect.
There is another option below which will let you edit your global linting settings:
You can also create a file named .eslintrc
in the root of your project.
Upvotes: 43
Reputation: 111
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.
Upvotes: 11
Reputation: 2000
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..!!!
Upvotes: 0
Reputation: 328
I tried Mohammad`s solution but it didn't work. I managed to work doing the following:
<PropertyGroup>
add the following entry:
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
Upvotes: 16