-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Prettier and ESLint in VS Code crash svelte compiler #3550
Comments
Running That string looks like the contents of a
|
@Conduitry OK, thanks for quickly investigating and pointing out the source. I'll raised it with prettier-plugin-svelte. |
@Conduitry After debugging a bit it seems ot me that when we configure eslint to call prettier, Thus, the error is in how I might be wrong but I think this should be reopened. Thanks |
How sure are we that this plugin is doing the right thing by swallowing everything outside of I haven't looked very far into how eslint works yet, but would it theoretically be possible for this plugin to return the whole .svelte file from the preprocessor instead of just an extract, if the mapping logic between lines and eslint issues is updated to match? Is that how it works? Not complaining about the plugin but trying to understand where to direct any effort to improve this labyrinth of tools. 😆 |
As far as I know, no one on the Svelte team has spent any time looking into how Prettier plugins work in general nor into how |
@Conduitry Sorry let me rephrase! I'm looking for the maintainers' technical opinion on the possibility of having the eslint plugin working on the whole file instead. If the maintainers are open to explore the idea, it's more enticing to start trying to solve it. :) No I get that the Prettier plugin isn't official and that maybe noone in the Svelte team uses Prettier, and am not asking your to prioritize it although I'm sure tons of newcomers will want this support... 😉 |
I'd like to add my support to this, at least as a single newcomerto svelte. My workflow always included prettier to reformat my messy editing on file save. So it was natural to continue to use it for the JS part of svelte files. I get that svelte files are NOT javascript but a compiled super set and that might lead to some issues but in general I want prettier to continue to work. In fact I doubt there will be any issues as Richard was careful to overload existing JS syntax for all new features - eg labels |
@Conduitry I just can't see a single valid argument of yours other than: it is official and therefore it does the right thing. How would you be able to tell whether or not a third-party-plugin of a tech you (and all others of the svelte devs) didn't even spent time to understand works or works not the right way? |
Describe the bug
With this template where we want ESLint to co exist with prettier I have 2 problems when the plugins are nebale with this config
As described in the prettier docs this enable ESLint to call prettier
Logs
see stack trace
To Reproduce
Uncommented the line aboveand comment the one above it
Expected behavior
Stacktraces
Stack trace
$ npm run lint
ParseError: Expected }
1 | export let name
2 |
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\steve\AppData\Roaming\npm-cache_logs\2019-09-11T17_00_42_583Z-debug.log
Information about your Svelte project:
Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
Not relevant - build error
Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
Windows 10 latest 1903
Svelte version (Please check you can reproduce the issue with the latest release!)
3.12.1
Whether your project uses Webpack or Rollup
Roll up
Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
Serious - can't lint or run prettier on svelte files
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: