biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.19k stars 473 forks source link

Allowlist a domain for `lint/a11y/noBlankTarget` #3609

Closed ematipico closed 1 month ago

ematipico commented 2 months ago

Discussed in https://github.com/biomejs/biome/discussions/3513

Originally posted by **GRA0007** July 24, 2024 We have a few sites that we manage, and currently any links between them we manually disable the `lint/a11y/noBlankTarget` rule so our analytics can track clicks between them. We're not worried about security given that all the sites are ours. This results in about 100 or so links with a manual ignore comment. I'd like to propose a config option that allowlists certain domains to allow `target="_blank"` without `noreferrer` set. Something like this would be great: ```json { "noBlankTarget": { "options": { "allowDomains": ["ourdomain.com", "oursubdomain.hostingprovider.net"] } } } ``` I believe this aligns with the ethos of this rule, as it's designed to prevent security issues with 3rd party sites, but managing multiple sites and linking between them is a common use-case.
Jayllyz commented 2 months ago

Can i work on this?

ematipico commented 2 months ago

All yours @Jayllyz

Feel free to ask any questions here