Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Local prettier format on save #1340

Discussion options

You must be logged in to vote

Ok, what ultimately worked was adding svelte to extra_filetypes:

null_ls.setup({
    debug = true,
    sources = {
        formatting.prettier.with({
            extra_filetypes = { "svelte" },
        }),
   },

It's interesting that my local .prettierrc has the following, which I thought would be enough for it to find svelte files:

    "plugins": [
        "prettier-plugin-svelte"
    ],
    "pluginSearchDirs": [
        "."
    ],
    "overrides": [
        {
            "files": "*.svelte",
            "options": {
                "parser": "svelte"
            }
        }
    ]

I did confirm changing the .prettierrc file has an effect on how it formats .svelte files in this local pr…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@kelbyfaessler
Comment options

@kelbyfaessler
Comment options

@kelbyfaessler
Comment options

Comment options

You must be logged in to vote
1 reply
@jose-elias-alvarez
Comment options

Answer selected by kelbyfaessler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants