Skip to content

vue-doctor/performance/js-early-exit ​

Use early returns to flatten deeply nested conditions for better readability

PropertyValue
CategoryPerformance
Default Severitywarning
Confidencelow
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt
Test filesNot checked (which files)

Why it matters ​

Use early returns to flatten deeply nested conditions for better readability

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Flatten deeply nested conditionals with guard clauses: return early for the failing cases and keep the main path unindented. Do not change behaviour.


Rule source: vue-doctor/performance/js-early-exit

Released under the MIT License.