-
Notifications
You must be signed in to change notification settings - Fork 98
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
"Crash" when used with prettier and eslint #57
Comments
I faced with the same issue. Any update on this? |
Me too! |
It seems like |
I have the same problem, which means I am not using let b:ale_linter_aliases = {'svelte': 'javascript'}
let b:ale_linters = ['eslint',]
let b:ale_fixers = ['prettier',] I haven't got as far as figuring out where to start with a fix for the underlying issue. |
Did some debugging, seems like I'm trying to get this confirmed in the Prettier community but it seems to me like the eslint plugin is at fault here for not sending the whole file, which Prettier is capable of parsing (with the plugin). The JSX in the template part of .svelte files should also be formatted by Prettier, and if we look at I'd like to ask the Svelte community why they say that |
@torndev I found the same and worked around this in VS Code - see https://github.com/SteveALee/svelte-code-cypress-project/blob/master/README.md I created a bug with more details here sveltejs/svelte#3550 but seems it was the wrong place. Also jamesbirtles/svelte-vscode#74 Also see |
@SteveALee Yeah the answer to sveltejs/svelte#3550 is what's making me confused. It would seem like exactly the right place to resolve the problem. Maybe we can try to get it reopened. |
EDIT: In the TypeScript roadmap they already mention separation of the Svelte core from tooling and taking inspiration from Vue, and UnwrittenFun seems involved in this. So focusing on Thought I'd share my findings so far. Perhaps someone knows more and/or would like to join the search for a solution! I haven't worked with eslint plugins before, I'm just digging in node_modules trying to trace the plugin call order. We have eslint calling The maintainers of Next step is to determine how hard it would be to move the TL;DR: lots of intrigue simply because I don't know how any of this works... 😆 |
I think that I'm facing the same issue. I'm linting with
... is causing
Repo with the minimal setup required to reproduce is here. To reproduce, simply run |
* Setup svelte project * pull out eslint + prettier integration and use prettier directly: sveltejs/prettier-plugin-svelte#57
As stated in the newest Prettier docs, using packages like |
@dummdidumm But only eslint plugins provide "realtime" linting inside the IDE, or not? In my workflow I'm gettung linting errors etc. highlighted while i'm typing. With the plugin I also get prettier "errors" highlighted while typing. It's a thing of preference, but I prefer it this way instead of constantly getting my code reformatted on save e.g. |
I'm getting this error, too. It would be really annoying to use Prettier separately because every single non-svelte project has Prettier integrated with ESLint. So Svelte projects are the only projects requiring me to setup extra tooling. |
The problem is neither |
@dummdidumm I tried your suggestion and it seems to resolve the crash issue. However the linter still reports false positive errors for prettier/prettier:
That is the line: |
From prettier/eslint-plugin-prettier#472 (comment)
|
I think this can be closed in favor of prettier/eslint-plugin-prettier#483 |
I don't think so, I am still getting this error with the [email protected] and the official eslint-plugin-svelte3: I have not tried this with the recommended eslint-plugin-svelte package yet. |
Please see sveltejs/svelte#3550 for details, though is closed there.
I copied the original bug report here, thanks
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: