Disabling the green line in the Angular 2+ html template

How can I get rid of the following squiggly green line while I edit the Angular 2+> = v2 project html template (v2 or higher) without changing the template itself: Suppose I have the following line:

<textarea [(ngModel)]="jobDescription" cols="40" rows="5" (ngModelChange)="textAreaEmpty()"></textarea> <br/> 

Above the line inside the Visual Studio code (1.11.1), the Editor looks as follows

enter image description here

Pay attention to the squiggly green line? If I hung over him, I see the following hint:

enter image description here

Suggesting: "The attribute name [[(ngModel)]] must be lowercase. I want to ignore this sentence. How can I achieve this without disabling all editor suggestions?

I am pleased with other potential editor suggestions, but for this I would like to disable this green signal.

Update 1: my workspace settings are as follows

 { "files.exclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/CVS": true, "**/*.js.map": true, "**/.DS_Store": true, "**/*.js": { "when": "$(basename).ts"} }, "window.zoomLevel": 0, "html.suggest.angular1": false } 

Update 2 : even adding "html.suggest.angular1": false did not turn off this warning, and I still see them in my editor:

Note. I have the following extensions installed:

  • Angular TypeScript Snippets for VS Code
  • angular2 -inline
  • Azure Tools Features - VS Code Extensions
  • VS Code - Debugger for Chrome
  • VS Code ESLint Extension
  • Git History (including git magazine)
  • Visual Studio HTML Snippets
  • vscode-htmlhint
  • IntelliSense for CSS Class Names
  • Latest TypeScript and Javascript Grammer
  • Visual Studio Command Line Extension
  • Visual Studio Team Services Status Extension for Visual Studio Code

enter image description here

Final update:

In my case, the culprit was HTMLHint . I disabled the extension and reloaded the workspace, and now I no longer see the green line.

+5
source share
3 answers

Go to File → Settings → Settings

Open the html panel and check this line:

 // Configures if the built-in HTML language support suggests Angular V1 tags and properties. "html.suggest.angular1": true, 

it must be false .

+6
source

This comes from TSLint / Codelyzer, which is specific to the project itself. Unfortunately, while TSLint supports rule flags in code to disable rules for certain lines, there is no support for HTML files. you can edit this rule in tsconfig.json, but a more elegant solution would be to go to File> Settings> Preferences, select the TSLint section and add glob *.html to `tslint.exclude".

EDIT: Undeleted for @echonax, but I deleted it first because I think its answer is correct! I will leave it here independently.

+2
source

I managed to get rid of the annotations by adding the .htmlhintrc file to the root path in my project and adding the following values:

{"attr-lowercase": false, "doctype-first": false}

+2
source

Source: https://habr.com/ru/post/1266703/


All Articles