refactor(linter/plugins): reduce code nesting#16719
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the getParseOptions function by reducing code nesting through early returns and flattening nested conditional blocks. The refactoring makes the code more readable without changing its behavior.
Key Changes:
- Introduced early return when
languageOptionsis null to eliminate the outermost nesting level - Flattened the error-throwing logic for custom parsers by removing unnecessary nesting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5fc1eb8 to
f509ef4
Compare
849f5bd to
e1eebb7
Compare
Merge activity
|
Pure refactor. Flatten a large `if` block, to make the code easier to follow.
e1eebb7 to
32e23f7
Compare
f509ef4 to
4d9e981
Compare

Pure refactor. Flatten a large
ifblock, to make the code easier to follow.