-
-
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: import/order named not working with spread operator #3146
base: main
Are you sure you want to change the base?
Conversation
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. |
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 recognize platform
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 imports platform
and works, and one that imports a
and/or browser
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
Fixes #3145