Closed RikuVan closed 5 years ago
By the way, it would be super helpful if you could provide an example of how the options, like ignoring styles, are actually used with the .eslintrc.
I can't reproduce this. I have a package.json containing:
{
"dependencies": {
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-svelte3": "^1.0.0",
"svelte": "^3.1.0",
"typescript": "^3.4.5"
}
}
a .eslintrc containining:
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["svelte3", "@typescript-eslint"],
"extends": "standard",
"parserOptions": {
"extraFileExtensions": [".svelte"]
},
"rules": {
"semis": 0,
"space-before-function-paren": 0,
"no-console": "off"
}
}
and a test.svelte containing:
<script>
export let src =
'https://images.pexels.com/photos/356378/pexels-photo-356378.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500'
export let alt = 'white-dog'
</script>
<img
src="https://images.pexels.com/photos/356378/pexels-photo-356378.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt="hey"
/>
and when I run ./node_modules/.bin/eslint test.svelte
I get no errors. If I edit the file to introduce a linting error (e.g., adding a semicolon), I do see that error.
Do you have a repo where I can reproduce this issue?
I can try later to put the code on online somewhere, e.g. codesandbox or glitch.
When I clone that project, install dependencies, and run the lint
script I get:
/.../svelte3-ts-starter/src/components/Image.svelte
2:2 error Parsing error: Expression expected
✖ 1 problem (1 error, 0 warnings)
sorry that was probably was slightly different than the version I had locally, which I now pushed--namely the linting was removed.
Anyways, if you don't get a similar issue, then I should do something in Glitch so we know it is not some other environment issue. node v11.10.0 by the way.
Okay, thanks, yep I am seeing the same exception as you are now.
https://github.com/RikuVan/svelte3-ts-starter/blob/master/yarn.lock#L2710 You're running Svelte 3 beta 3. Beta 4 introduced some changes to the output of the compiler that this plugin needs. You need to upgrade to a newer version, preferably one of the official non-beta releases from this past week.
oh no, sorry to trouble you with old version. Works now of course.
I am getting this error (trace below). I thought this was perhaps due to using the typescript parser but it seems to occur even if I remove the parser. Any suggestions would be much appreciated about how to proceed/ debug the issue.
eslintrc: