CodingGarden / listd

listd is a Full Stack App that will allow users to create, share and watch lists of YouTube channels. This app is being built LIVE on Twitch https://twitch.tv/codinggarden
https://twitch.tv/codinggarden
MIT License
190 stars 53 forks source link

Fix parseForESLint is invalid #58

Closed Kibujiro closed 1 year ago

Kibujiro commented 1 year ago

Describe the bug

npm run lint is not able to validate NavTrail.svelte.

I tried to reinstall the whole project but I am not able to get the linter to work with this file.

Screenshots

image

Reproduction

Checkout the latest main branch and run npm run lint

Logs

> listd@0.0.1 lint
> eslint --ext .js,.cjs,.ts,.svelte .

Error while parsing ***\NavTrail.svelte
Line 1, column 8: '>' expected.
`parseForESLint` from parser `@typescript-eslint/parser` is invalid and will just be ignored

Have you checked if this issue has already been raised?

Code of Conduct

Kibujiro commented 1 year ago

Seems like this is already the case since the merge was done: https://github.com/CodingGarden/listd/pull/38/checks

image
omar2205 commented 1 year ago

1- This is a warning, and most likely it's a result of Svelte +(listd's) ESLint rules. This should be named "Fix parseForESLint is invalid`". Check https://github.com/typescript-eslint/typescript-eslint/issues/1333 2- Good security tip, don't use blur/pixelation to redcat info. A black rectangle works well.

MrAmericanMike commented 1 year ago

Same error, in my case the console output is

Error while parsing /home/---/Github/CodingGarden/listd/src/routes/NavTrail.svelte
Line 1, column 8: '>' expected.
`parseForESLint` from parser `@typescript-eslint/parser` is invalid and will just be ignored

/home/---/Github/CodingGarden/listd/src/routes/NavTrail.svelte
  44:19  error  Insert `·`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

husky - pre-commit hook exited with code 1 (error)

I'm guessing eslint doesn't like the lang="ts" in the .svelte file, but even then, if we remove that, it will still complain about some different error.

Error while parsing /home/---/Github/CodingGarden/listd/src/routes/NavTrail.svelte
Line 2, column 1: Expression expected.
`parseForESLint` from parser `@typescript-eslint/parser` is invalid and will just be ignored

/home/---/Github/CodingGarden/listd/src/routes/NavTrail.svelte
  44:19  error  Insert `·`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.
omar2205 commented 1 year ago

I mean,

It's just a warning

w3cj commented 1 year ago

This was fixed by removing .svelte from the settings import/parsers section, since .svelte files are already handled by the overrides parser.

https://github.com/CodingGarden/listd/blob/1079ae3c5517f16c17270699d2b27ae3835e6912/.eslintrc.cjs#L40