Skip to content

Add lint rule to discourage Flash usage - #630

Open
llastflowers wants to merge 3 commits into
mainfrom
llastflowers/5437/discourage-flash
Open

Add lint rule to discourage Flash usage#630
llastflowers wants to merge 3 commits into
mainfrom
llastflowers/5437/discourage-flash

Conversation

@llastflowers

@llastflowers llastflowers commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a primer-react/no-deprecated-flash rule
  • report named and aliased Flash imports from @primer/react and @primer/react/deprecated
  • direct developers to Banner and the Flash migration guide
  • enable the rule as a warning in the recommended configuration

Part of github/primer#5437.

Validation

  • npm test
  • npm run lint
  • npm run lint:md
  • npm run format:check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 70736adb-aaef-4999-bbdd-c76914f5f8aa
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b6fab6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-primer-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

llastflowers and others added 2 commits August 19, 2026 14:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 70736adb-aaef-4999-bbdd-c76914f5f8aa
@llastflowers
llastflowers marked this pull request as ready for review August 19, 2026 21:55
@llastflowers
llastflowers requested a review from a team as a code owner August 19, 2026 21:55
@llastflowers
llastflowers requested review from liuliu-dev and a lite review from Copilot August 19, 2026 21:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new ESLint rule to the eslint-plugin-primer-react plugin to discourage use of the deprecated Flash component by flagging Flash named imports (including aliased imports) from @primer/react and @primer/react/deprecated, and guiding developers toward Banner and the Flash migration guide.

Changes:

  • Added a new rule (primer-react/no-deprecated-flash) that reports Flash named imports from Primer React entrypoints.
  • Added RuleTester coverage for valid/invalid import patterns (including aliased imports).
  • Documented the rule, linked it from the README, and enabled it as a warning in the recommended config (with a changeset for release notes/versioning).
Show a summary per file
File Description
src/rules/no-deprecated-flash.js Implements the new rule by reporting Flash named imports from supported Primer React entrypoints.
src/rules/tests/no-deprecated-flash.test.js Adds tests validating both non-triggering imports and triggering Flash imports (including aliasing/mixed imports).
src/index.js Exports the new rule from the plugin entrypoint.
src/configs/recommended.js Enables the new rule as warn in the recommended preset.
README.md Adds the new rule to the documented rules list.
docs/rules/no-deprecated-flash.md Adds rule documentation with correct/incorrect examples and a migration link.
.changeset/curly-horses-fold.md Declares a minor version bump for the new rule addition.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants