Skip to content

Conversation

@EvanReinstein
Copy link
Contributor

Running npm run prepack or npm run build in react-paypal-js completes successfully, however there are several warnings:

  • spread array operator warning.
  • output to filesystem is defaulting to true warning (see below comment for explanation).

The spread array operator warning stems from using v5 of @typescript-eslint/eslint-plugin and @typescript-eslint/parser. Currently, paypal-js uses v6 of both of these packages, so this change upgrades to match paypal-js. There were a few lint issues in V5 SDK-related files that have been fixed or ignored.

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

🦋 Changeset detected

Latest commit: e8537df

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

This PR includes changesets to release 1 package
Name Type
@paypal/react-paypal-js 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

"ignore": "^5.2.0",
"natural-compare-lite": "^1.4.0",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
Copy link
Contributor Author

@EvanReinstein EvanReinstein Dec 8, 2025

Choose a reason for hiding this comment

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

This dependency, tsutils, is the culprit behind the spread operator warning log. Basically this package depends on tslib v1.4.1 while we wanted tslib v2.6.2. So react-paypal-js was using an older tslib version by proxy.

The updated typescript-eslint packages do not leverage tsutils and therefore do not have the older dependency.

};

export const Default: FC<StoryProps> = ({ amount, styles, style }) => {
export const Default: FC<StoryProps> = ({ styles, style }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed unused variable amount.

Comment on lines +8 to 9
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Allow any for dynamic SDK options
[key: string]: any;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considered changing this to [key: string]: unknown but then opted for the eslint-disable-next-line to avoid breaking any integrations.

plugins: [
typescript({
tsconfig: "./tsconfig.lib.json",
outputToFilesystem: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default value for outputToFilesystem is true and if you haven't explicitly set the value here it also triggers a warning. So technically we were already writing output to a .tsbuildinfo file in the dist. Updating this to false will remove that buildinfo file.

@EvanReinstein EvanReinstein marked this pull request as ready for review December 8, 2025 21:14
@EvanReinstein EvanReinstein requested a review from a team as a code owner December 8, 2025 21:14
Copy link
Contributor

@kand kand left a comment

Choose a reason for hiding this comment

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

Nice!

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.

4 participants