You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done a ton of searching and debugging, and I have not have found anybody else reporting this problem, but I think I understand why it's happening, at least.
Assume I have a file at src/svelte/routes/index.svelte that I have properly passed to eslint to lint.
When I run eslint, I simply get no output. It doesn't report any errors, so it appears like everything passed. However, if I turn on debug logging in eslint with DEBUG=eslint:* eslint, I see this problem occur after the Svelte processor splits up the file into the named blocks:
eslint:linter With ConfigArray: [BASE PATH OF MY PROJECT]\src\svelte\routes\index.svelte\0_instance.ts +0ms
eslint:linter Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src\svelte\routes\index.svelte\0_instance.ts.
The file must be included in at least one of the projects provided.
eslint:linter Error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src\svelte\routes\index.svelte\0_instance.ts.
The file must be included in at least one of the projects provided.
The TypeScript parser complains that it can't find 0_instance.ts (and 1_template.ts and so on), even though you can see that the path should match the includes in my tsconfig.json. I experimented with many combinations of settings and paths, but nothing worked.
It finally dawned on me that TypeScript is probably looking for a real file on disk at src/svelte/routes/index.svelte/0_instance.ts, which of course doesn't actually exist. Sure enough, I finally found mention of this in a more general context in this issue: typescript-eslint/typescript-eslint#3174 (comment)
A little more info in this one: typescript-eslint/typescript-eslint#4360
This appears to mean that typescript-eslint simply does not (will not?) support "virtual files" like those created by the Svelte processor in this plugin when using the named-blocks setting. Any files passed to the TypeScript parser must actually exist on disk.
My knowledge about all this stuff is limited to what I've been able to Google, so I'm not sure what the way to fix this would be. But it would be really great if this scenario was supported.
The text was updated successfully, but these errors were encountered:
I've done a ton of searching and debugging, and I have not have found anybody else reporting this problem, but I think I understand why it's happening, at least.
My goal is to use the svelte3/named-blocks feature while also using the TypeScript parser.
Here's an example
.eslint.cjs
:Relevant paths part of
tsconfig.json
:Assume I have a file at
src/svelte/routes/index.svelte
that I have properly passed to eslint to lint.When I run eslint, I simply get no output. It doesn't report any errors, so it appears like everything passed. However, if I turn on debug logging in eslint with
DEBUG=eslint:* eslint
, I see this problem occur after the Svelte processor splits up the file into the named blocks:The TypeScript parser complains that it can't find
0_instance.ts
(and1_template.ts
and so on), even though you can see that the path should match theincludes
in mytsconfig.json
. I experimented with many combinations of settings and paths, but nothing worked.It finally dawned on me that TypeScript is probably looking for a real file on disk at
src/svelte/routes/index.svelte/0_instance.ts
, which of course doesn't actually exist. Sure enough, I finally found mention of this in a more general context in this issue: typescript-eslint/typescript-eslint#3174 (comment)A little more info in this one: typescript-eslint/typescript-eslint#4360
This appears to mean that typescript-eslint simply does not (will not?) support "virtual files" like those created by the Svelte processor in this plugin when using the
named-blocks
setting. Any files passed to the TypeScript parser must actually exist on disk.My knowledge about all this stuff is limited to what I've been able to Google, so I'm not sure what the way to fix this would be. But it would be really great if this scenario was supported.
The text was updated successfully, but these errors were encountered: