-
-
Notifications
You must be signed in to change notification settings - Fork 24
Error parsing spread syntax with lang="pug"
#228
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
Comments
Thank you for posting issue. I don't use pug so I'm not sure if it's possible. |
It looks like it is possible to pull out the same trick svelte-preprocess does synchronously. There are two objections to it however:
What do you think? Do you plan to support the whole gamut of languages supported by svelte-preprocess in this parser/plugin, and if yes then what's your vision for it (AST / rules)? Would you accept Pug parsing support without a plan to fix cursor position? |
If it doesn't return the correct position of the node, ESLint's auto-fix will break the source code and is unacceptable.
The However, those who worked on eslint-plugin-vue's experimental Pug support quickly stopped maintaining them. |
Before You File a Bug Report Please Confirm You Have Done The Following...
*.svelte
file linting does not work with the parser alone. You should also use eslint-plugin-svelte with it.)What version of ESLint are you using?
8.25.0
What version of
eslint-plugin-svelte
andsvelte-eslint-parser
are you using?What did you do?
Configuration
.eslintrc.yaml
Test.svelte
What did you expect to happen?
Successful parse.
What actually happened?
$ eslint Test.svelte
/home/projects/node-zm1om6/Test.svelte
7:8 error Parsing error: Unexpected token
✖ 1 problem (1 error, 0 warnings)
Link to Minimal Reproducible Example
https://stackblitz.com/edit/node-zm1om6?file=Test.svelte
Additional comments
With
("{...obj}")
dropped linter issuesno-unused-vars
andno-undef
. It seemseslint-plugin-svelte
processes markup as plaintext.With
svelte-preprocess
in place Svelte compiler won't issue a warning; however a genuine error would likely result in incorrect line number. Apparently preprocessor does not map original pug to resulting html (same issue with sass). Not good in compiler, it's probably a no-go for linter.That sounds like a load of work and wontfix. However if you think it's feasible please outline the solution, I'd like to dig in.
The text was updated successfully, but these errors were encountered: