False positive on rule Web:S6840

Must-share information :

Non-compliant Angular code :

<custom-selector
           type="text"
           autocomplete="family-name"
           formControlName="REDACTED"
           label="REDACTED"
           name="REDACTED"
           placeholder="REDACTED"
            >
</custom-selector>

I am having a hard time figuring out what is non-compliant about this code.

Especially since I have another tag in the same file with slightly different values which happens to be compliant. (see below)
Compliant Angular code :

<custom-selector
           type="tel"
           autocomplete="tel"
           formControlName="REDACTED"
           label="REDACTED"
           name="REDACTED"
           placeholder="REDACTED"
            >
</custom-selector>

Is there an explanation for this issue or is it a false positive ?
Thanks for your help

Hi,

It looks like you’re running into

SONARHTML-292 - S6840 triggers on custom components

Altho that doesn’t explain why you don’t get an issue on both examples. I’m going to flag this for the language experts in case they want to expand on the ticket description / examples.

 
Ann

Hello @Rom,

as @ganncamp mentioned this is related to the previous ticket. The problem was that custom components were never considered as input fields (but were not a problem for tel). I just implemented the fix and should be shipped with the next version of SQS.

Cheers,
Victor

1 Like

Thanks for the update.
I’m waiting for the 2025.1.2 then :slight_smile:

Hi,

Language analyzers aren’t updated in LTA point releases. You’ll need to upgrade to 2025.3, when it’s available, to get this fix.

 
Ann

Hi,

Thank you for the clarification.

Rom

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.