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

Comment on a new line gives error #15

Open
Brianzchen opened this issue Aug 14, 2023 · 2 comments
Open

Comment on a new line gives error #15

Brianzchen opened this issue Aug 14, 2023 · 2 comments

Comments

@Brianzchen
Copy link

import {
  BaseButton,
  Box,
  Provider,
  // here is a comment
  Typography,
  theme,
} from '...';

I'm getting Import lines cannot have more than one blank line between them. when I have a comment, maybe this is a bug given that it's not a newline but a comment?

If it helps, I'm using hermes-parser to parse my JS not sure if that would cause a problem

Screenshot 2023-08-14 163347

@SeinopSys
Copy link
Owner

SeinopSys commented Aug 14, 2023

I am having quite a difficult time dealing with comments in the imports as I need to reconstruct the import statement from scratch each time to check how the fixed output would look like and adding comment processing to that is a significant effort for me. I already made an exception for the ts-ignore comments above the last line of the import but supporting every possible scenario starts to get out of hand. (think: line comment above the import, just after it, or block comments in either position)

I'll leave the issue open but I consider this issue really low priority and I'm not giving an ETA for a fix. My suggestion would be to stop commenting inside the imports, but I understand this is not something that is always within your control. In such cases I suggest not using this plugin or contributing a fix via a PR.

@Brianzchen
Copy link
Author

Thanks for the insight. I'm a fan of what this plugin provides so I'm keen to keep using it, I'll see what I can come up with

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