Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.6k
fix: import/order named not working with spread operator#3146
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecovbot commentedJan 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #3146 +/- ##==========================================- Coverage 95.59% 95.17% -0.42%========================================== Files 83 83 Lines 3629 3630 +1 Branches 1282 1283 +1 ==========================================- Hits 3469 3455 -14- Misses 160 175 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We should only do this if node's cjs-module-lexer also recognizes it. Let's discuss in the issue. |
test({ | ||
options: [ | ||
{ | ||
named: true, | ||
}, | ||
], | ||
code: ` | ||
const test = { | ||
a: 1, | ||
browser: 2, | ||
}; | ||
module.exports = { | ||
...test, | ||
platform: 'node', | ||
}; | ||
`, |
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.
i'd like to also include a test that demonstrates that we only recognizeplatform
as a named export from this file.
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.
Im not that familiar with this codebase. How could I test this?
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.
you'd want to make a fixture file with this test code in it, and then make two test cases that import this test file - one that importsplatform
and works, and one that importsa
and/orbrowser
and fails.
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.
Im very sorry but can't figure it out. I added the cases but it doesn't fail? I suspect that I'm doing something wrong but cant figure out what.
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.
Can you push up what you have? I'll take a look.
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.
I tried looking at#3032 as it had fixture files I believe
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.
@ljharb did you have a chance to look?
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.
?
Fixes#3145