Skip to content

Add optional chain to return #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025
Merged

Add optional chain to return #359

merged 3 commits into from
Jul 7, 2025

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy