Skip to content

Parsing error when using dot notation in use directive. #248

Closed
@thenbe

Description

@thenbe

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

  • I'm using eslint-plugin-svelte. (*.svelte file linting does not work with the parser alone. You should also use eslint-plugin-svelte with it.)
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-svelte repo and open the issue in eslint-plugin-svelte repo if there is no solution.
  • 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.28.0

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

What did you do?

Configuration
<!-- Paste your configuration here -->

Playground minimal reproduction here.

Same example in svelte REPL to show this is valid svelte syntax: link

<script>
  function myaction(n) {};

  const myobj = { myaction };
</script>

<!-- works -->
<div use:myaction />

<!-- Parsing error: Expected JS identifier.ESLint(FATAL) -->
<div use:myobj.myaction />

What did you expect to happen?

Parsed without error.

What actually happened?

Error: Parsing error: Expected JS identifier.ESLint(FATAL)

Link to GitHub Repo with Minimal Reproducible Example

https://ota-meshi.github.io/eslint-plugin-svelte/playground/#eJxVjkELgkAQhf/K5EkPm3ezwIMdwkNg0MWLraNM6KzsrlKI/721wuj2Zt7j45s8qSr0Ii/eCAFXbKXqEKwCNC2xFX07NMTCjNhaBCEOBcdGauqtSwD1wNKSYuie5Tv4HMA0F7yUUrGxrlG3O+xhWjcw7xwlXDHuqGiEwWC0TsLPf5E6l9oQN4BaKx1B+uhRWqzglANVyJZqQr1N88z5+sfkkmTBV/RHdQrbP7Y3vwCISlaj

Additional comments

Use case: HeadlessUI library

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions