Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
UnderKoen wants to merge2 commits intoimport-js:main
base:main
Choose a base branch
Loading
fromUnderKoen:fix/3145

Conversation

UnderKoen
Copy link

Fixes#3145

@codecovCodecov
Copy link

codecovbot commentedJan 17, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.17%. Comparing base(341178d) to head(7db7e10).
Report is 17 commits behind head on main.

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.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ljharb
Copy link
Member

We should only do this if node's cjs-module-lexer also recognizes it. Let's discuss in the issue.

Comment on lines +3652 to +3668
test({
options: [
{
named: true,
},
],
code: `
const test = {
a: 1,
browser: 2,
};

module.exports = {
...test,
platform: 'node',
};
`,
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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

Copy link
Author

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ljharbljharbljharb left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

import/order with named fails when exporting uses spread operator.
2 participants
@UnderKoen@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp