Skip to content

Create a lint rule to encourage inline prop for <Link>s in text block #182

@khiga8

Description

@khiga8

Problem statement

There is a gap in in-editor tooling to ensure that Links in text block have the inline prop set on it for accessibility.

While we do have the in-browser axe checks to encourage setting inline, having tooling as people are writing code is the most impactful/proactive. The in-browser axe checks are limited in coverage.

Akin to the lint rule that we've introduced in ERB, there is an opportunity to introduce an ESLint rule in Primer React that nudges setting the inline prop for <Link> when the link is identified as being inside of a block. This would also help prepare for the next major release when inline becomes the default.

Important note: Static analysis is limited so this will not flag everything. However, it should help improve coverage!

Acceptance criteria

  • Introduce a new lint rule that flags any links that are detected as being inside of a text block, but missing the inline prop.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions