Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Helge
    @Tylopilus
    <body>
        <shared-button name="Peter" class="sc-shared-button-h hydrated">
          <div class="sc-shared-button">hi Peter,</div>
          <button class="sc-shared-button">load tic</button>
        </shared-button>
        <my-input class="sc-my-input-h hydrated"
          ><input type="text" class="sc-my-input" /><button class="sc-my-input">
            clear</button
          ><button class="sc-my-input">load</button></my-input
        >
        <h1>Hallo Welt</h1>
      </body>
    Helge
    @Tylopilus
    <my-input class="sc-my-input-h hydrated"
          ><input type="text" class="sc-my-input" /><button class="sc-my-input">
            clear</button
          ><button class="sc-my-input">load</button></my-input
        >
    this part looks iffy for me though
    Jed Fox
    @j-f1
    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">
            clear</button
          > <button class="sc-my-input">load</button></my-input
        >
    That’s the general idea ^
    Helge
    @Tylopilus
    I see what may be the side effects that prettier cannot enforce a propper line break by its own?
    Matt Rossman
    @mattrossman
    image.png
    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
    @byronferguson
    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
    @wondersloth

    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

    hbs`<div></div>`

    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 {
      <template>
        <div>Some Hbs here.</div>
      <template>
    };

    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
    @anthonyronda
    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
    @jasikpark
    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
    @jasikpark
    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
    @adi518
    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
    @thien-do
    Hi, the Prettier extension in VSCode and the CLI have different result. How should I start to debug this?
    Lalit Kumar
    @lalitmee
    Why prettier is changing this
    image.png
    to this
    image.png
    my eslint is throwing a warning for the second syntax
    William Brockhus
    @YodaDaCoda
    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
    @YodaDaCoda
    oh joy, Prettier ignores files that it doesn't recognise the extension for when run against a directory. Using a glob pattern instead works.
    qwhatevera
    @qwhatevera
    image.png
    how to fix this? Please help me ..
    qwhatevera
    @qwhatevera
    Does anyone know how to solve this problem?
    Ryan Zimmerman
    @RyanZim
    @qwhatevera are you using the correct parser (JSON)?
    qwhatevera
    @qwhatevera
    @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
    @qwhatevera

    @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
    @RyanZim
    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
    @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
    qwhatevera
    @qwhatevera
    @RyanZim Thanks for your reply, it works.