Skip to content

refactor: W-18488820 - last of fs and eslint rule #6390

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

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from

Conversation

CristiCanizales
Copy link
Contributor

@CristiCanizales CristiCanizales commented Jul 1, 2025

What does this PR do?

This pull request introduces several updates across the codebase, focusing on improving code quality, enforcing stricter linting rules, transitioning to asynchronous patterns, and enhancing compatibility with web extensions. Below is a summary of the most important changes grouped by theme.

Linting and Code Quality Improvements:

  • Updated the linting rule for @typescript-eslint/no-floating-promises from warn to error to enforce stricter handling of unresolved promises. (eslint.config.mjs, eslint.config.mjs L133-R133)
  • Added a new no-restricted-imports rule to restrict usage of Node.js fs and fs-extra modules, recommending the use of VSCode's fs API for compatibility with web extensions. (eslint.config.mjs, eslint.config.mjs R290-R301)

Asynchronous Code Transition:

  • Converted synchronous methods to asynchronous ones in the ApexDebugForTest class, ensuring proper handling of asynchronous operations. (apexDebugForTest.ts, packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugForTest.ts L103-R117)
  • Updated unit tests in apexDebug.test.ts and commandOutput.test.ts to use await for testing asynchronous methods, improving reliability and readability. (apexDebug.test.ts, [1]; commandOutput.test.ts, [2]

Debugger Enhancements:

  • Removed unused lines and improved formatting in the ApexReplayDebug class for better readability and maintainability. (apexReplayDebug.ts, [1] [2]

Compatibility Updates:

  • Introduced the packages/salesforcedx-apex-replay-debugger directory to the ESLint configuration, ensuring it adheres to the project's linting rules. (eslint.config.mjs, eslint.config.mjsR410)
  • Suppressed the no-restricted-imports rule in specific files where usage of Node.js fs is necessary for integration tests. (logContextUtil.ts, [1]; goldFileUtil.ts, [2]

Miscellaneous Improvements:

What issues does this PR fix or reference?

@W-18488820@

@CristiCanizales CristiCanizales self-assigned this Jul 1, 2025
@CristiCanizales CristiCanizales requested a review from a team as a code owner July 1, 2025 21:40
@CristiCanizales CristiCanizales requested a review from randi274 July 1, 2025 21:40
@CristiCanizales CristiCanizales changed the base branch from develop to cristi/core-no-fs July 1, 2025 21:44
Base automatically changed from cristi/core-no-fs to develop July 1, 2025 23:42
@CristiCanizales CristiCanizales requested review from mshanemc, kylewalke, peternhale, daphne-sfdc and madhur310 and removed request for randi274 July 1, 2025 23:44
Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

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

see inline comments. I think fixing the rule to only be node:fs will make this all easier.

@CristiCanizales CristiCanizales requested a review from mshanemc July 3, 2025 18:53
@mshanemc
Copy link
Contributor

mshanemc commented 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