Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

svelte parsing error in template literals #346

Open
@AdrianGonz97

Description

@AdrianGonz97

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.41.0

What version ofeslint-plugin-svelte are you using?

2.29.0

What did you do?

Configuration
module.exports = {root: true,extends: ['eslint:recommended','plugin:@typescript-eslint/recommended','plugin:svelte/recommended','prettier'],parser: '@typescript-eslint/parser',plugins: ['@typescript-eslint'],parserOptions: {sourceType: 'module',ecmaVersion: 2020,extraFileExtensions: ['.svelte']},env: {browser: true,es2017: true,node: true},overrides: [{files: ['*.svelte'],parser: 'svelte-eslint-parser',parserOptions: {parser: '@typescript-eslint/parser'}}]};
<script>let workaround=setInitialClassState.toString();functionsetInitialClassState() {// does something}</script><svelte:head><!-- This causes the new eslint-plugin-svelte to throw a parsing error -->{@html`<script nonce="%sveltekit.nonce%">(${setInitialClassState.toString()})();</script>`}<!-- This is works -->{@html`<script nonce="%sveltekit.nonce%">(`+workaround+`)();</script>`}</svelte:head>

What did you expect to happen?

I migrated over to this plugin from the now deprecatedeslint-plugin-svelte3. The previous one didn't throw this parsing error.

What actually happened?

/parsing-error-eslint-plugin-svelte/src/routes/+page.svelte  11:45  error  Parsing error:')' expected✖ 1 problem (1 error, 0 warnings)

Link toGitHub Repo with Minimal Reproducible Example

https://github.com/AdrianGonz97/parsing-error-eslint-plugin-svelte

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp