Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Matthew Adams
    @matthewadams
    ^^^ @jlongster ?
    Matthew Adams
    @matthewadams
    Um, anyone? Bueller?
    verdecchia
    @verdecchia:matrix.org
    [m]
    Hi to everybody! I'm an Italian software developer and I added prettier to an existing project. Everything works like a charm, but I got an with a 'p' tag element. Well, in real I dislike how this 'p' element was used and I removed it, but I'm wondering why this happens.
    May someone could help me and answering why it happens? Maybe I'm doing something wrong in vue? Thanks!
    Kristina
    @KristinaPlusPlus
    Hello! I am taking a stab at writing my first prettier plugin for blazor support. I'd love feedback and potentially help debugging the two issues I have logged against myself -> https://github.com/KristinaPlusPlus/prettier-plugin-razor
    bytreakz
    @bytreakz

    Hey Guys, I just got prettier and it makes my
    <a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">Wikipedia</a>

    into:
    <a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA"

        >Wikipedia</a

    >

    it it somehow possible to make my code look like this:
    <a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">
    Wikipedia
    </a>

    ?

    bytreakz
    @bytreakz

    See https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting

    it works now with "ignore", thanks! Is it normal that it stays in one line if I change my print width settings from 80 to 100 or can I change it somehow that i looks like this:
    <a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">
    Wikipedia
    </a>
    ?

    Jed Fox
    @j-f1
    If the element fits on one line within the printWidth, we will print it on one line.
    bytreakz
    @bytreakz
    okay, thanks for the fast answers! :)
    Christopher G
    @ChrisG661
    hello! i was using prettier in vscode for HTML and somehow it started to ignore the line/print wrap on class attributes. It only happens when i am saving the file, but behaves accordingly when invoked manually using format document. how do i troubleshoot this?

    it ignores the line wrap when i format on save:

    <div
      class="flex flex-row items-stretch w-full mx-auto space-x-1  justify-evenly justify-items-stretch h-80"
    >

    but when ran manually with format document it correctly wraps:

    <div
      class="
        flex flex-row
        items-stretch
        w-full
        mx-auto
        space-x-1
        justify-evenly justify-items-stretch
        h-80
      "
    >
    Christopher G
    @ChrisG661
    it also works on some other file when i set "html.format.wrapLineLength": to 80
    Jed Fox
    @j-f1
    Maybe you’re using a different formatter for format on save? I think there’s an option in settings.json to change the default formatter both globally and by file type.
    Helge
    @Tylopilus
    Hi Chat, is there a bug in the html formatting or am I missing out a config?
    ```
    <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