Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): improve the diagnostics emitted by noUnreachable #3348

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 5, 2022

Summary

Fixes #2961

This PR improves the range-merging logic of the noUnreachable rule to allow large sections of unreachable code to be reconstructed from many disjoint instruction-level ranges. I also took the opportunity to rework how the advices emitted in the diagnostics are sorted and worded to make better use of the new diagnostics rendering.

Test Plan

I've added a new MergeRanges test case that checks the range merging works correctly for all the supported control flow statements, and I've updated a few other snapshots that were also impacted by this change.

@leops leops requested a review from xunilrj as a code owner October 5, 2022 17:13
@netlify
Copy link

netlify bot commented Oct 5, 2022

Deploy Preview for rometools ready!

Name Link
🔨 Latest commit eb39b80
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/633e86940b49530008754a4c
😎 Deploy Preview https://deploy-preview-3348--rometools.netlify.app/docs/lint/rules/nounreachable
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@leops leops temporarily deployed to netlify-playground October 5, 2022 17:20 Inactive
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

@leops leops force-pushed the fix/unreachable-range branch from 004b599 to eb39b80 Compare October 6, 2022 07:41
@leops leops requested a review from a team October 6, 2022 07:41
@leops leops temporarily deployed to netlify-playground October 6, 2022 07:41 Inactive
@ematipico ematipico added the A-Diagnostic Area: errors and diagnostics label Oct 6, 2022
@leops leops added this to the 10.0.0 milestone Oct 6, 2022
@leops leops merged commit c854ce1 into main Oct 6, 2022
@leops leops deleted the fix/unreachable-range branch October 6, 2022 09:00
@leops leops added the A-Linter Area: linter label Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Diagnostic Area: errors and diagnostics A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Analyzer: too many diagnostics forjs/noDeadCode
2 participants