Skip to content

Add an eslint rule to discourage use of Flash and use Banner component instead.Β #383

@pksjce

Description

@pksjce

This is a task for https://github.com/github/primer/issues/5437

  • Flash component will be deprecated and removed from @primer/react
  • There are many usages of this component, so we need a lint rule to discourage its usage.

Here are a few test cases for the rule to apply

import {Flash} from "@primer/react"

<Flash variant="warning" sx={{fontSize: 0, borderRadius: 0, py: 2, px: 3}}>
  Banner content
</Flash>

should be replaced with

import {Banner} from "@primer/react/experimental"

<Banner variant="warning" sx={{fontSize: 0, borderRadius: 0, py: 2, px: 3}}>
  Banner content
</Banner>

In the same manner, preserve any other properties on the Flash component and preserve all types of content inside the component.
Any other logic or conditional around the code should be preserved.
Create more test cases if required

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions