Skip to content

<svelte:element {any props}> not being parsed correctly #437

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

Closed
2 tasks done
JaKXz opened this issue Apr 8, 2023 · 0 comments · Fixed by sveltejs/svelte-eslint-parser#316
Closed
2 tasks done

Comments

@JaKXz
Copy link

JaKXz commented Apr 8, 2023

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.38.0

What version of eslint-plugin-svelte are you using?

2.26.0

What did you do?

I have <svelte:element this="script" /> in my App.svelte and this seems to cause the eslint plugin to fail. If you comment out this line there are no errors. https://github.com/JaKXz/eslint-svelte-repro/blob/461a388de934850df39d7d13b73c4aa2cb3b3b30/src/App.svelte#L32-L33

Minimal .eslintrc.cjs:

module.exports = {
  root: true,
  extends: ["eslint:recommended", "plugin:svelte/recommended"],
  parserOptions: {
    sourceType: "module",
    ecmaVersion: "latest",
  },
  env: {
    browser: true,
  },
};

What did you expect to happen?

eslint should pass without issues in the minimal repro repo.

What actually happened?

> [email protected] lint /Users/jasonkurian/src/github.com/jakxz/eslint-svelte-repro
> eslint .


/Users/jasonkurian/src/github.com/jakxz/eslint-svelte-repro/src/App.svelte
  0:0  error  Parsing error: Cannot use 'in' operator to search for 'range' in script

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/JaKXz/eslint-svelte-repro

Additional comments

No response

@JaKXz JaKXz changed the title <svelte:element> not being parsed correctly <svelte:element ...> not being parsed correctly Apr 8, 2023
@JaKXz JaKXz changed the title <svelte:element ...> not being parsed correctly <svelte:element {any props}> not being parsed correctly Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant