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

Relative paths broken when named-blocks = true #36

Closed
maxmilton opened this issue Jul 13, 2019 · 6 comments
Closed

Relative paths broken when named-blocks = true #36

maxmilton opened this issue Jul 13, 2019 · 6 comments
Labels
invalid This doesn't seem right

Comments

@maxmilton
Copy link

We now have the svelte3/named-blocks option (fixed #22), which is amazing, thank you.

While adding it in my ESLint preset, I found relative import paths are reporting unresolved. Looks like because the file path is changed to *.svelte/*.js, rules from the eslint-plugin-import package now think the file is nested a directory deeper than it really is.

@Conduitry
Copy link
Member

Huh. I'm not sure what can be done about this or whether this is something that the ESLint folks already thought about or what. If I'm using named blocks, I don't really have any control over its being down an additional level. I just tell ESLint I want to use the filename instance.js, say, and it constructs the new path from that, here. I'll have to ask the ESLint Gitter.

@Conduitry Conduitry added the help wanted Extra attention is needed label Jul 13, 2019
@Conduitry
Copy link
Member

Asked the Gitter. I may also well need some help chasing this one down, as there are a few separate parties involved here, and I'm not sure who's going to end up being responsible for this.

@Conduitry
Copy link
Member

Also created an issue on eslint-plugin-import and linked back here.

@maxmilton
Copy link
Author

TBH I didn't realise named code blocks are a built-in feature of ESLint. It must not have been very prominent in the 6.0.0 changelogs.

Since it's a native part of ESLint it makes sense that eslint-plugin-import should be the place to fix this.

Not sure if there's anything else to do here. Feel free to close if you think that's appropriate.

@Conduitry
Copy link
Member

Yeah, I think it makes sense to close this. I'm not sure what is going to happen in eslint-plugin-import exactly, but it does seem like it's their responsibility if they're going to support ESLint 6.

@Conduitry Conduitry added invalid This doesn't seem right and removed help wanted Extra attention is needed labels Jul 14, 2019
@Conduitry
Copy link
Member

Added a note to https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md with a link to the eslint-plugin-import issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants