Automattic / Automattic/VIP-Coding-Standards

New Sniff: target="_blank"

未关闭
#481 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
Good First Issue help wanted Standard: VIP-Go Type: Enhancement
主要语言
PHP
星标
261
派生
44
平均合并
19 分钟
30 天内合并 PR
1

描述

## What problem would the enhancement address for VIP?
There's a potential issue with using `target="_blank"` and not using `rel="noopener"` or `rel="noreferrer"`.
See: https://web.dev/external-anchors-use-rel-noopener/

## Describe the solution you'd like

Maybe warn about this if we see `noopener` or `noreferrer` present?

## What code should be reported as a violation?

`Link`

## What code should *not* be reported as a violation?

`Link`

OR

`Link`

贡献指南

打开贡献指南

调研方向

首先检查仓库中现有的 sniffs 和 PHP_CodeSniffer 规则,确认它们如何检查锚点属性。确认带有 target="_blank" 的 会被报告,除非 rel 包含 noopener 或 noreferrer,并确认两个符合要求的示例会被接受。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
tooling
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。