Alt property in Angular

html

(Ubcent) #1

Hi guys,

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Version 6.7.1 (build 35068)
    Quality profile Sonar way recommended
    Framework: Angular 6.0.9
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    “Images tags and buttons should have an alt attribute” warning occurs when alt is used in property bindings in template ([alt]=”expression”).
  • steps to reproduce
  1. Add property binding for alt in template
    Actual result: warning with “add an alt attribute to this image” occurs
    Expected result: No warnings occur

(Nicolas Harraudeau) #3

Hi @ubcent

Thank you for your feedback.

It makes indeed sense to support Angular’s property binding syntax.
I created the following ticket: https://jira.sonarsource.com/browse/SONARHTML-92. The rule you mention is listed there as RSPEC-1077.

Best regards,

-Nicolas