-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: support multiple imports of one module with multiple lines #30314
Conversation
|
@wenfw Could you write a test for this change? |
@jennifer-shehane Test cases have been updated. Thanks. |
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.
Hi @wenfw. Thank you for the contribution! At first glance I am not sure exactly what this is solving. Can you add a more descriptive PR description to describe the current problem and how your solution addresses that problem?
@AtofStryker The import {
a,
b,
c,
} from 'x'; Changing it to Using the current regular expression |
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.
LGTM
npm/vite-plugin-cypress-esm/cypress/component/importSyntax.cy.ts
Outdated
Show resolved
Hide resolved
@wenfw everything looks good. Are you able to add a changelog entry? |
89e7724
to
f61adeb
Compare
e.g. ``` import { a, b, c, } from 'x'; ``` chore: remove unnecessary deep equal Co-authored-by: Bill Glesias <[email protected]>
I'm not sure if this PR has gone through correctly regarding changelog and release.
|
@MikeMcC399 Thanks for surfacing! We're looking into this. |
Looks like this released yesterday to npm https://www.npmjs.com/package/@cypress/vite-plugin-cypress-esm. When the percy job fails it is fairly hard to rectify and usually means it will release on the next passing merge to develop, which happened to be 06aeb9d (which also removes the entry). |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
The
.
in RegExp matches all characters except line terminators, so the following won't match:Changing it to
[^;'"]
allows it to match all characters, including\n
, except for;'"
, which resolves the issue.Using the current regular expression
/(?<=^|\s)import (.+?) from ['"](.*?)['"]/g
will cause the new test cases to fail.Additional details
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?