chore: fix linting errors ( Step 2 )#150
Open
milindmore22 wants to merge 2 commits into
Open
Conversation
…s for better static analysis compatibility
…ces, and sanitize error handling across frontend components
milindmore22
marked this pull request as ready for review
July 3, 2026 12:26
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.
What
This PR improves code consistency, reliability, and maintainability across several React components in the admin interface. It standardizes variable naming conventions, updates dependency arrays for React hooks to prevent stale closures, and simplifies error handling in asynchronous operations.
Why
These changes are necessary to ensure the React UI reacts correctly to state changes without encountering stale closures. Furthermore, standardizing to
camelCaseand consistently using thewindownamespace improves codebase readability. The PR also patches specific bugs, such as accidental site removal in the site selection logic and the leaking of sensitive error details to users during copy-to-clipboard actions.Related Issue(s):
Covers Step2 : https://github.com/rtCamp/OnePress/issues/78
Step 1 : #149
How
camelCase(e.g., convertingsetup_urltosetupUrl,site_typetoinitialSiteType) and ensured global configuration objects consistently use thewindownamespace (e.g.,window.OneUpdatePlugins).useEffectanduseCallbackacross multiple components (PluginManager,S3Credentials,GitHubRepoToken,PluginGrid,PluginsSharing,S3ZipUploader) to include all referenced functions and variables.catchblocks for cleaner asynchronous code and standardized the API key copy-to-clipboard error logic to prevent leaking underlying error details to the user.useCallback, particularly withinS3ZipUploaderandGitHubRepoToken, to optimize rendering performance.Testing Instructions
useCallbackrefactoring behave as expected.Screenshots
N/A
Additional Info
Code cleanup in catch blocks makes the overall footprint smaller. The adjustments to the
useEffectarrays should drastically reduce the chance of silent UI bugs related to stale state.Checklist