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

Non-alphanumeric character as comment in import not detected #169

Closed
ineshbose opened this issue May 5, 2023 · 1 comment
Closed

Non-alphanumeric character as comment in import not detected #169

ineshbose opened this issue May 5, 2023 · 1 comment

Comments

@ineshbose
Copy link

ineshbose commented May 5, 2023

Environment

Any

Reproduction

This would work brilliantly:

import {
  member1,
  // test
  member2
} from "module-name";

But not this:

import {
  member1,
  // .@hello-test!
  member2
} from "module-name";

See example: https://stackblitz.com/edit/github-tvia8w?file=registry.tsx

Describe the bug

This is likely due to the regex being strict using \w so non-alphanumeric characters in the comment causes it to not be picked up; it can be switched by using \S, though I feel current behaviour is also fair. Just raising this, but if you desire to keep it this way, please feel free to close this issue.

Additional context

No response

Logs

No response

@pi0 pi0 closed this as completed in c4159e5 Jun 20, 2023
@pi0
Copy link
Member

pi0 commented Jun 20, 2023

Hi. Thanks for repro. I have made a small fix to handle your edge cases. Please mention if there is anything similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants