-
Notifications
You must be signed in to change notification settings - Fork 123
Fix: react-paypal-js build warnings #757
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e8537df The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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" |
There was a problem hiding this comment.
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 }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused variable amount.
| // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Allow any for dynamic SDK options | ||
| [key: string]: any; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
kand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Running
npm run prepackornpm run buildinreact-paypal-jscompletes successfully, however there are several warnings:The spread array operator warning stems from using v5 of
@typescript-eslint/eslint-pluginand@typescript-eslint/parser. Currently,paypal-jsuses v6 of both of these packages, so this change upgrades to matchpaypal-js. There were a few lint issues in V5 SDK-related files that have been fixed or ignored.