Automattic / Automattic/VIP-Coding-Standards

New Sniff: target="_blank"

Open
#481 1 comment 1 reaction 0 assignees View on GitHub
Good First Issue help wanted Standard: VIP-Go Type: Enhancement
Dominant language
PHP
Stars
261
Forks
44
Avg merge
19m
Merged PRs (30d)
1

Description

## 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`

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the repository's existing sniffs and PHP_CodeSniffer rules for how anchor attributes are inspected. Confirm that an with target="_blank" is reported unless rel contains noopener or noreferrer, and that the two compliant examples are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.