-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Fix] order
: ensure arcane imports do not cause undefined behavior
#3128
base: main
Are you sure you want to change the base?
Conversation
order
: ensure arcane imports do not cause undefined behaviororder
: ensure arcane imports do not cause undefined behavior
d929108
to
400fb1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good overall, assuming the test fails without the fix :-)
853d7b6
to
321c79c
Compare
…a `sortTypesAmongThemselves` Closes import-js#2912 import-js#2347 import-js#2441 Subsumes import-js#2615
…y imports via `newlines-between-types`
321c79c
to
64ccfb5
Compare
64ccfb5
to
a77d6b4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3128 +/- ##
==========================================
+ Coverage 95.59% 95.65% +0.06%
==========================================
Files 83 83
Lines 3629 3658 +29
Branches 1282 1305 +23
==========================================
+ Hits 3469 3499 +30
+ Misses 160 159 -1 ☔ View full report in Codecov by Sentry. |
It's a little interesting that codecov believes this PR does not reduce coverage, this PR that includes the changes from the two preceding PRs... both of which codecov claims have reduced coverage 😄 |
Depends on #3127
This PR implements in
import/order
: a fix to ensureNaN
is never passed into rank-computing functions, which can result in undefined behavior.A demo package containing this fix is temporarily available for easy testing:
Ensure strange imports do not cause strange behavior
There are certain edge cases where a
NaN
rank gets passed around, such as using an import with an absolute specifier under certain configurations. The fix concerns thecomputeRank
function.This PR includes a unit test to catch potential regressions.