-
Notifications
You must be signed in to change notification settings - Fork 98
Description
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
- Lint crashes in the svlte compile - see stack trace
- Prettier fails to format on save the App.svelte file - and error flashes up in the status bar
Logs
see stack trace
To Reproduce
Uncommented the line aboveand comment the one above it
- Run npm run lint from the command line
- edit the App.svelte and save the file
Expected behavior
- no error and llinter succeeds
- File is reformated via prettier
Stacktraces
Stack trace
$ npm run lint
[email protected] lint C:\projects\svelte-code-cypress-project
eslint src/*
ParseError: Expected }
1 | export let name
2 |
3 | {name;name=0}
| ^
Occurred while linting C:\projects\svelte-code-cypress-project\src\App.svelte:3
at error$1 (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13329:20)
at Parser$2.error (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13405:10)
at Parser$2.eat (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13419:19)
at mustache (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13220:17)
at new Parser$2 (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13364:22)
at Object.parse$1 [as parse] (C:\projects\svelte-code-cypress-project\node_modules\svelte\compiler.js:13495:21)
at Object.parse (C:\projects\svelte-code-cypress-project\node_modules\prettier-plugin-svelte\plugin.js:669:51)
at Object.parse$2 [as parse] (C:\projects\svelte-code-cypress-project\node_modules\prettier\index.js:10629:19)
at coreFormat (C:\projects\svelte-code-cypress-project\node_modules\prettier\index.js:13888:23)
at format (C:\projects\svelte-code-cypress-project\node_modules\prettier\index.js:14146:73)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] lint:eslint src/*
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
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.