Open miauk22 opened 2 years ago
@miauk22 can you please provide me with a GitHub repository I can clone that demos this?
Can you please add an eslint configuration. I get
Error: No ESLint configuration found in /workspaces/eslint-svelte-issue/svelte-typescript-app/src.
at CascadingConfigArrayFactory._finalizeConfigArray (/workspaces/eslint-svelte-issue/svelte-typescript-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3962:19)
at CascadingConfigArrayFactory.getConfigArrayForFile (/workspaces/eslint-svelte-issue/svelte-typescript-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3753:21)
at CLIEngine.getConfigForFile (/workspaces/eslint-svelte-issue/svelte-typescript-app/node_modules/eslint/lib/cli-engine/cli-engine.js:971:14)
at ESLint.calculateConfigForFile (/workspaces/eslint-svelte-issue/svelte-typescript-app/node_modules/eslint/lib/eslint/eslint.js:664:26)
at /home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:176344
at Ce (/home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:186295)
at h.then.o.validate (/home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:176323)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Should be fine now, for some reason it was not uploaded earlier
Which extension are you using to get Svelte support. An extension is necessary otherwise the language id "svelte"
is not known.
Thanks!
@dbaeumer , do you still need more info about this one?
@miauk22
The auto detection of Svelte is not working. However, you can enforce it via the eslint.validate
setting. Something like
"eslint.validate": [
"javascript",
"svelte"
]
Thanks @dbaeumer your comment helped me fix the issue I had!
My eslint
output on the CLI produced very different output to what VS Code was showing and setting it explicitly solved it.
@dbaeumer I had this, as written at the beginning of this story. For some reason it is still not working for me for one specific project, it looks like it works for different ones though. In the original one I had "Unexpected token" every time and for every Svelte file. What helped (kind of) was removing VS Code, clearing AppData/Roaming/Code directory, installing again, now everything works fine.
Whenever I try to lint Svelte file I get
Unexpected token
error fromeslint(ParseError)
in very random places, but always at first few lines of file. Linting with CLI works fine, It's also working with Atom and Webstorm.I'm using following stuff:
with
dbaeumer.vscode-eslint
extension v2.2.2.File
.eslintrc.json
(without our rules):Added following to
settings.json
for VS Code:In output from ESLint extension there are no errors.