refactor(lint): enable class-methods-use-this ESLint rule - W-22068833#7208
Open
refactor(lint): enable class-methods-use-this ESLint rule - W-22068833#7208
Conversation
…imple-condition-first Upgrades eslint-plugin-unicorn from 62.0.0 to 64.0.0 and enables the new prefer-simple-condition-first rule to enforce simpler conditions first in logical expressions for better readability. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds packages/salesforcedx-vscode-lightning/src/resources/** to the eslint ignore patterns. These files contain vendored third-party code (Aura framework, polyfills) that use patterns incompatible with modern lint rules like no-array-reverse. The unicorn/no-array-reverse rule is already enabled and now applies only to our codebase, not vendored code. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Addresses 20 class-methods-use-this violations by extracting utility methods to module-level functions where appropriate and suppressing the rule for interface implementations. Changes: - Extracted pure utility functions to module level in testController.ts, orgApexClassProvider.ts, apexTestingDiscoveryFsProvider.ts, and apexTestRunCodeAction.ts - Added eslint-disable comments for methods that must remain instance methods due to interface requirements (ParametersGatherer, LibraryCommandletExecutor, FileSystemProvider, etc.) - Wrapper methods delegate to module-level functions for cleaner separation This aligns with the preference for module-level functions over static methods or unnecessary instance methods. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removes pointless wrapper methods that only delegated to module-level functions. Calls module-level functions directly instead. Changes: - testController.ts: removed 4 wrapper methods, call functions directly - apexTestRunCodeAction.ts: removed 2 wrapper methods, extracted handleDiagnostics to module level Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Enables class-methods-use-this rule for SOQL packages and addresses 15 violations by adding eslint-disable comments for polymorphic methods and interface implementations. All violations are legitimate cases where methods must remain instance methods due to: - Abstract class polymorphism (validators, analyzers) - Interface implementations (DataProvider, SelectCount) - Protected helper methods in parser infrastructure Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
daphne-sfdc
approved these changes
Apr 20, 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.
What issues does this PR fix or reference?
@W-22068833@
Before/After
eslint-plugin-unicornto 64.0.0; enableprefer-simple-condition-firstclass-methods-use-thisrule; fix violations inapex-testingapex-testingclass-methods-use-thisrule insoqlMade with Cursor