Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

False positive rule lint/a11y/useValidAnchor when calling a function #3590

Closed
1 task done
MaximeCheramy opened this issue Nov 8, 2022 · 0 comments · Fixed by #3599
Closed
1 task done

False positive rule lint/a11y/useValidAnchor when calling a function #3590

MaximeCheramy opened this issue Nov 8, 2022 · 0 comments · Fixed by #3599
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Milestone

Comments

@MaximeCheramy
Copy link

Environment information

CLI:
  Version:              10.0.0
  Color support:        true

Platform:
  CPU Architecture:     x86_64
  OS:                   linux

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"

Rome Configuration:
  Status:               loaded
  Formatter disabled:   false
  Linter disabled:      false

Workspace:
  Open Documents:       0

Discovering running Rome servers...

Server:
  Status:               stopped

What happened?

app/modules/[deleted].tsx:102:67 lint/a11y/useValidAnchor ━━━━━━━━━━

  ✖ Provide a valid value for the attribute href.

    100 │                   [deleted]
    101 │                   [deleted]
  > 102 │                   <td>{cExport.exportBinaryId != null && <a href={getFileUrl({ id: cExport.exportBinaryId })}>Download</a>}</td>
        │                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    103 │                   [deleted]
    104 │                 [deleted]

  ℹ The href attribute should be a valid a URL

  ℹ Check this thorough explanation to better understand the context.

The getFileUrl returns a string and it can't be null / undefined.

Expected result

This code should be considered as valid.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@MaximeCheramy MaximeCheramy added the S-To triage Status: user report of a possible bug that needs to be triaged label Nov 8, 2022
@MaximeCheramy MaximeCheramy changed the title 🐛 <TITLE> False positive rule lint/a11y/useValidAnchor when calling a function Nov 8, 2022
@xunilrj xunilrj self-assigned this Nov 8, 2022
@MichaReiser MichaReiser added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Nov 9, 2022
@leops leops added this to the 10.0.1 milestone Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants