-
-
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
Named code blocks confuse relative import paths #1415
Comments
What are named code blocks? Is it a JavaScript feature I’m unaware of? |
It's a new feature with processors in ESLint 6 - https://eslint.org/docs/user-guide/configuring#specifying-processor |
So these are nonexistent virtual files that are different from the only previous instance of these, which is “stdin” - looks like this is something eslint v6 has forced every plugin to potentially handle - since my assumption is that a plugin’s visitors get called on this code block as if it was a normal file. One option is to bail out early on every cross-file rule; but a better one would be to treat them like normal files. A PR to fix this, with test cases, would be appreciated. |
I'm not sure how a plugin would be able to distinguish between a virtual named block file, and a file that's inside a folder whose name simply contains a |
eslint itself may provide that information in the file’s context; I’m not sure yet. |
I don't believe the necessary information is currently available. Opened eslint/eslint#11989 |
Can this be closed now? It sounds like #2160 should have addressed this. |
I think you're right. |
Excuse me for asking, but do the restrictions (especially the ones for |
If not, please file a new issue - note you may need a svelte-specific import resolver. |
Hey there! I'm the author of a processor plugin that produces named code blocks, which are confusing this plugin, because the new virtual path for the js files is now one additional layer down.
I'm not sure whether this plugin is something that was considered when named code blocks were added in ESLint 6, or whose responsibility it's going to be to fix this. I'll gladly make changes to my plugin if that's what it takes, but right now I don't know what those would be.
Thanks!
See also:
The text was updated successfully, but these errors were encountered: