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

Not working with prettier 3.0.1 #74

Open
atuleu opened this issue Aug 3, 2023 · 3 comments
Open

Not working with prettier 3.0.1 #74

atuleu opened this issue Aug 3, 2023 · 3 comments

Comments

@atuleu
Copy link

atuleu commented Aug 3, 2023

Since prettier v3.0.1 this package is not working

Given a svelte file

<script>
        import '@skeletonlabs/skeleton/themes/themes-skeleton.css';
        import '@skeletonlabs/skeleton/styles/skeleton.css';
        import '../app.postcss';
</script>

<slot />

The emacs command M-x prettier-js is returning the error:

prettier errors:
[warn] Ignored unknown option --stdin.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[error] /home/atuleu/devel/github.com/formicidae-tracker/formicidae-tracker.github.io/src/routes/+layout.svelte: Error: printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed
[error]     at printEmbeddedLanguages (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/index.mjs:17595:11)
[error]     at printAstToDoc (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/index.mjs:17726:9)
[error]     at async coreFormat (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/index.mjs:18037:14)
[error]     at async formatWithCursor (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/index.mjs:18235:\
    14)
[error]     at async formatStdin (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/internal/cli.mjs:6689:23) 
[error]     at async main (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/internal/cli.mjs:6972:5)
[error]     at async Module.run (file:///home/atuleu/.nvm/versions/node/v18.17.0/lib/node_modules/prettier/internal/cli.mjs:6928:5)                                                                                                                                

Running npm install -g prettier@2 solved the issue. I guess version 3 removed some options from prettier and this package should be updated.

p.s.: the { pluginSearchDirs: ["."] } comes from svelte default .prettierrc file.

@hegde-atri
Copy link

bump

@hegde-atri
Copy link

I'd like to contribute to this somehow, if anyone's got any idea. I don't think it'd get merged, since I couldn't find any PRs closed since 2020

@LazerJesus
Copy link

same.

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

3 participants