Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Xunnamius
Copy link
Contributor

@Xunnamius Xunnamius commented Dec 23, 2024

Depends on #3127

This PR implements in import/order: a fix to ensure NaN 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:

npm install --save-dev eslint-plugin-import@npm:@-xun/eslint-plugin-import-experimental

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 the computeRank function.

This PR includes a unit test to catch potential regressions.

@Xunnamius Xunnamius changed the title [New] order: ensure arcane imports do not cause undefined behavior [Fix] order: ensure arcane imports do not cause undefined behavior Dec 23, 2024
@ljharb ljharb marked this pull request as draft December 23, 2024 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant