Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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.
    nicolas.deveaud
    @nicolas.deveaud:matrix.org
    [m]
    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 😉
    whycomeimsocool
    @whycomeimsocool:matrix.org
    [m]
    Hi everyone :) does anyone know how to stop prettier from changing <br> into <br /> ????
    jn
    @ziddey
    using react + htm instead of jsx. I'd like to make use of embedded language formatting, but the default html parser changes attributes like colSpan to colspan which obviously makes react unhappy. I suppose I could make a custom parser and change all my template tags from html to match? Anyone have a better idea?
    jmkozko
    @jmkozko
    hi, is there a way to disable this rule for chained decorators? i see that prettier wants this:
    @Returns(200, SomeClass).Description('Description Here')
    to be formatted as
    @(Returns(200, SomeClass).Description('Description Here'))
    this only occurs when the decorators are chained
    jmkozko
    @jmkozko
    or is there a way to print debug information to see what rule was violated?
    netzego
    @netzego:matrix.org
    [m]
    Hey everyone, is it possible to stop the ugly linebreaks somehow?
    {% extends "base.html" %}
    {% block content %}
    <h1 class="title">:-)</h1>
    {% endblock content %}
    {% extends "base.html" %} {% block content %}
    <h1 class="title">:-(</h1>
    {% endblock content %}
    Riho Pihlak
    @rpihlak
    Hi! I'm trying to create a plugin for formatting embedded SQL in TS. The plugin works on SQL files but not embedded SQL. I defined name, parsers and extensions in languages. Am I missing something? Is it at all possible? I tested with the following example.
    console.log(html`<DIV>  </DIV>`); // works
    console.log(sql`CREATE TABLE example (  id INT PRIMARY KEY  );`); // doesn't work
    Riho Pihlak
    @rpihlak
    Hi! Can the built-in TypeScript parser detect and parse embedded languages with plugins? I want to create a plugin for SQL to format embedded SQL in TypeScript files. Example:
    import { MigrationInterface, QueryRunner } from 'typeorm';
    
    export class CreateExtensionPgcrypto1616393535319 implements MigrationInterface {
      public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(sql`
          CREATE EXTENSION IF NOT EXISTS pgcrypto;
        `);
      }
    
      public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(sql`
          DROP EXTENSION pgcrypto;
        `);
      }
    }
    Paul Schreiber
    @paulschreiber
    Is there Prettier-TextMate integration? I found https://www.phpied.com/prettier-in-textmate/ and tried it, but it crashes on save (terminating with uncaught exception of type std::length_error: basic_string).
    ssbarnea
    @ssbarnea:matrix.org
    [m]
    i found a recent bug in prettier prettier/prettier#12364 and I was trying to find the line to fix myself but due to lack of prefix it seems hard to spot there the console output is made from.
    ssbarnea
    @ssbarnea:matrix.org
    [m]
    is this channel really used by prettier devs?
    i tried finding another one but i was not able to find it yet.
    I would like to keep the code in the h2 compact and almost the same
    Ben Allfree
    @benallfree
    hey everyone, is there any reason prettier wouldn't be formatting Typescript code blocks in markdown? a js fence works, but ts fence doesn't seem to have any effect
    ```js
    // This gets formatted
    ```
    ```ts
    // This doesn't :(
    ```
    joebalzac
    @joebalzac
    How do I stop prettier from formatting all files in project
    eg...when I push to Github it says 111 files changes, I only want it to show the files that have been actually changed?
    Please help!
    Eric G
    @EricG-Personal
    @joebalzac perhaps using .prettierignore is what you are looking for?
    I was hoping someone here may be able to help me out with this SO question…
    Mouad Ennaciri
    @mouadennaciri
    Hello, I have a simple question, how can we format the code with only the defined options.
    I run for example the command npx prettier --write --tab-width 2 "**/*.ts" to format the code in 2 spaces, but it also makes other changes like changing single quotes by double quotes...
    How can I define that I want to format only the spaces option?
    1 reply
    Damien Butt
    @damienbutt
    Hi all,
    Hopefully a simple question.
    Is there a way either in the vscode extension settings or with a prettier config file that I can add other file associations? For instance tell prettier to treat a .xyz extension as a .js file for formatting purposes?
    Without going down the route of creating a custom plugin
    Mopsior
    @Mopsior
    Hi, why this is not working?