Skip to content

Conversation

TylerJDev
Copy link
Member

Fixes an error when imported does not exist in the specifier object. Adds an optional chain to return for cases where imported isn't present.

@Copilot Copilot AI review requested due to automatic review settings June 30, 2025 15:33
@TylerJDev TylerJDev requested a review from a team as a code owner June 30, 2025 15:33
@TylerJDev TylerJDev requested a review from jonrohan June 30, 2025 15:33
Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: 3de0238

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 Patch

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

Copy link
Contributor

@Copilot Copilot AI left a comment

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 addresses an error when a specifier's "imported" property is missing by adding optional chaining support.

  • Update in rule file to use optional chaining on "specifier.imported.name" when checking existence in the "entrypoint" map.
  • Addition of a test case to cover wildcard import usage.
  • A changeset update documenting the fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/rules/no-deprecated-experimental-components.js Use optional chaining to safely access specifier.imported.name
src/rules/tests/no-deprecated-experimental-components.test.js Added test case for wildcard import scenario
.changeset/proud-terms-fetch.md Documents the fix for missing "imported" in specifier objects

@TylerJDev TylerJDev enabled auto-merge (squash) June 30, 2025 15:34
@TylerJDev TylerJDev disabled auto-merge July 7, 2025 16:11
@TylerJDev TylerJDev merged commit 1480eba into main Jul 7, 2025
9 checks passed
@TylerJDev TylerJDev deleted the fix-imported-error branch July 7, 2025 16:13
@primer-css primer-css mentioned this pull request Jul 7, 2025
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.

3 participants