Skip to content
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

Error with inline functions and pug templates #366

Open
mfinelli opened this issue May 12, 2023 · 0 comments
Open

Error with inline functions and pug templates #366

mfinelli opened this issue May 12, 2023 · 0 comments

Comments

@mfinelli
Copy link

Hi, I have the following output from running prettier and it tells me to open an issue, here's how to reproduce:

package.json:

{
  "name": "prettier-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@prettier/plugin-pug": "^2.5.0",
    "prettier": "^2.8.8",
    "prettier-plugin-svelte": "^2.10.0"
  }
}

Test.svelte:

<script>
        const someFunction = (someArg) => {
                console.log("something")
        };
</script>

<template lang="pug">
        button(on:click="{(e) => someFunction(e)}")
                | A button
</template>

Running npx prettier Test.svelte produces the following message:

Test.svelteThe following expression could not be formatted correctly. Please try to fix it yourself and if there is a problem, please open a bug issue: (e) => someFunction(e)
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

No branches or pull requests

1 participant