Programming

Visual Studio 2017에서 JavaScript 빌드 오류를 비활성화하는 방법은 무엇입니까?

procodes 2020. 6. 4. 21:21
반응형

Visual Studio 2017에서 JavaScript 빌드 오류를 비활성화하는 방법은 무엇입니까?


방금 Visual Studio 2017을 RC에서 최종으로 업데이트했습니다. 다음 오류가 발생하지 않았지만 최근 에이 오류가 발생합니다. 프로젝트를 빌드 할 때 다음 오류가 발생하여 웹 프로젝트가 시작되지 않습니다.

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

자바 스크립트 오류

Visual Studio 2017에서 JavaScript 작성 오류를 비활성화하려면 어떻게합니까?


나는 해결책을 찾는다.

  1. 열다 Tools > Options
  2. 탐색 Text Editor > JavaScript/TypeScript > EsLint(VS2017 15.8은 Linting아닙니다 EsLint)
  3. 설정 Enable ESLintFalse

ESlint 비활성화

Visual Studio> = 15.8.5 ESlint Visual Studio 15.8.5 비활성화


Visual Studio 2017 (v 15.8.0)에서 :

옵션 1 : 옵션> JS 오류

  1. 열다 Tools > Options
  2. 로 이동 Text Editor > JavaScript/TypeScript > Code Validation
  3. 설정 Enable JavaScript errorsfalse
  4. 또는 설정 Enable JavaScript errorstrueShow errors as warningstrue

이를 적용하려면 Visual Studio를 다시 시작해야했습니다.

옵션> JS 오류

옵션 2 : 옵션> 보풀

아래에 글로벌 린팅 설정을 편집 할 수있는 다른 옵션이 있습니다.

옵션> JS Linting

옵션 3 : .eslint 파일

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


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>

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.

여기에 이미지 설명을 입력하십시오

  1. Open Tools > Options
  2. Navigate to Text Editor > JavaScript/TypeScript
  3. => 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:

  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


Mohammad의 솔루션을 사용해 보았지만 운이 없어도 Rafeel 답변을 따르고 제안 된 코드 샘플을 추가하는 대신 아래 코드를 제거 web .csproj하고 마침내 프로젝트를 빌드하고 실행할 수있었습니다. 동일한 파일에서 두 곳을 제거해야했습니다. 여전히 제거 된 코드가 솔루션에 어떤 영향을 미치는지 알 수 없습니다.

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

이것이 또한 누군가가 하루를 구하는 데 도움이되기를 바랍니다 .. !!!

참고 URL : https://stackoverflow.com/questions/42724820/how-to-disable-javascript-build-error-in-visual-studio-2017

반응형