Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Jed Fox
    If you manually insert a space it will switch to a more “normal” formatting, it’s just that inserting that space may affect the layout in some cases so Prettier can’t automatically do it there.
    <my-input class="sc-my-input-h hydrated"
          > <input type="text" class="sc-my-input" /><button class="sc-my-input">
          > <button class="sc-my-input">load</button></my-input
    That’s the general idea ^
    I see what may be the side effects that prettier cannot enforce a propper line break by its own?
    Matt Rossman
    anyone know how I can stop prettier from adding this extra linebreak after string literal params? I use string literals a lot for GLSL shaders and it's annoying having it take up so much vertical space
    i guess it's kind of specific to string literals, for other kinds of params I'd expect the paren on a new line
    Byron Ferguson
    has their been a default config change recently? I have swathes of code where the class="" attribute in my HTML is now expanded to a single class per line.
    Matthew Edwards

    I have a question, if the following is possible with the plugin system.

    I want to extend the javascript printer to have an embed for a tagged template literal with


    This would be similar to the html tagged template literal but would be for handlebars syntax inside.

    If not that, potentially a version of the plugin that will process an alternative file extension .gjs which like react or something will have a <template> tag on a class.

    // ...
    export default class MyComponent extends Component {
        <div>Some Hbs here.</div>

    This format, I don't think warrants a change in the main repo of prettier, because the API is not final but for current application development in glimmer.js experimental fork.

    I've playing around with creating a plugin, but I can't really get the embed or print functions to recursively call as described from the documentation. I am seeing it get called once with the node being a file, but I thought it would be doing more.

    Anthony Ronda
    Hi y'all. Discovered no easy way to get Prettier to work with text files, even by doing a *.txt override with "parser" : "markdown", which is close enough for my needs. This seems like something I might have to submit as an Issue. Any advice or final checks I should try before I do?
    Caleb Jasik
    Hiya - is there a way to disable loading a parser automatically? We are currently developing a parser within a monorepo, and prettier is automatically pulling in the unfinished and broken language plugin and using it to format all of the Astro code in the repo...
    Caleb Jasik
    Well, for know our solution is to either disable embeddedLanguageFormatting or move the prettier-plugin-astro package into it's own repo out of the monorepo
    Adi Sahar
    Hey all. I have a legacy project and I want to avoid the space between function and its parentheses. Is there a way to disable it, because I couldn't find it in the docs and it's making my life needlessly hard.
    This publicAdapterMethods.forEach(function(method) { instead of this: publicAdapterMethods.forEach(function (method) {.
    Thien Do
    Hi, the Prettier extension in VSCode and the CLI have different result. How should I start to debug this?
    Lalit Kumar
    Why prettier is changing this
    to this
    my eslint is throwing a warning for the second syntax
    William Brockhus
    I've got a weird issue... Prettier is ignoring some files in my project and I can't figure out why.
    prettier --write .\src\ picks up most files, correctly ignores the ones it should, incorrectly ignores some files it shouldn't
    prettier --write full-path-to-file-which-should-be-ignored still ignores the file
    prettier --write full-path-to-file-which-should-not-be-ignored-but-is-when-run-on-the-directory correctly prettiers the file
    Any ideas how I can go about debugging this?
    William Brockhus
    oh joy, Prettier ignores files that it doesn't recognise the extension for when run against a directory. Using a glob pattern instead works.
    how to fix this? Please help me ..
    Does anyone know how to solve this problem?
    Ryan Zimmerman
    @qwhatevera are you using the correct parser (JSON)?
    @qwhatevera are you using the correct parser (JSON)?
    @RyanZim I don't know where to pick a parser.
    I'm testing in here:https://prettier.io/playground

    @qwhatevera are you using the correct parser (JSON)?

    I already know how to pick a parser and config in prettier.config.js,but I still don't know whick parser to pick to fix my problem? I mean change a parser maybe affect other files like .vue .css etc

    Ryan Zimmerman
    You need to use the json parser. You can select the parser in the sidebar of the playground.
    If you can't see the sidebar, click the Show Options in the bottom left of the playground
    @qwhatevera ^
    Thomas Jowsey
    Hey guys, not sure if this is a dumb ask but does anyone know if it's possible to have Prettier automatically format used snippets in VS Code? Thanks
    @RyanZim Thanks for your reply, it works.
    Hi everyone !
    I would love to know more about next release timing: who defines when the release is shipped, what are the steps before it is released, etc.
    I'm waiting for a fix to be released and I'd like to have a idea on how long it can take for this release to come.... of course this info would not change anything, but just knowing what is going on helps waiting 😅 And if by the way I can help.... why not 😉