fix(core): add pseudoClassEnabledElements to TypeScript types (PPLT-5013)#2204
Merged
Manoj-Katta merged 1 commit intomasterfrom Apr 29, 2026
Merged
Conversation
…013) The runtime config schema accepted `pseudoClassEnabledElements`, but the TypeScript definition in @percy/core did not include it, forcing TS users to suppress type errors when passing the option to percySnapshot. Adding it to CommonSnapshotOptions fixes the type for every SDK that imports SnapshotOptions from @percy/core (ember, puppeteer, playwright, selenium, webdriverio, etc.). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rishigupta1599
approved these changes
Apr 29, 2026
bhokaremoin
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pseudoClassEnabledElementstoCommonSnapshotOptionsin@percy/core's type definition (packages/core/types/index.d.ts), mirroring the runtime config schema inpackages/core/src/config.js.expectType) and negative (expectError) tsd assertions inpackages/core/types/index.test-d.ts.Why
The runtime config schema has accepted
pseudoClassEnabledElementssince the original PPLT-5013 fix, but the TypeScript definition in@percy/coredid not include it. As a result, TypeScript users have to suppress type errors (// @ts-ignoreoras any) when passing the option topercySnapshot(). This was reported in customer ticket PER-6872 (Salsify):Since every Percy SDK (
@percy/ember,@percy/puppeteer,@percy/playwright,@percy/selenium,@percy/webdriverio, etc.) importsSnapshotOptionsfrom@percy/core, this single change fixes the type for all of them.Test plan
yarn test:typespasses insidepackages/corefile:link to local@percy/core:{ selectors, id, className, xpath }compiles cleanly.unknown: ['x']) is rejected by tsc withTS2353, confirming the type is not loosened toany.Related