Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Michael Rutter
    I'm very confused
    Jed Fox
    Huh. I’m not very active in Prettier anymore and I’m also very confused. Can you open an issue so the other maintainers can take a look? If you can, it would be great to include an example of what’s being changed.
    Michael Rutter
    because it seems like the reported config location and printed config are not the one used at all
    the only thing I can say that has changed, is we have introduced yarn workspaces and lerna
    but I've looked inside of node_modules/.bin and and node_modules/prettier and it all appears to be 2.1.2
    Michael Rutter
    so interestingly, if I add an explict {"printWidth": 80} to my config file
    it now does what --no-config does
    something somewhere is making the default higher than 80
    Jed Fox
    the only thing I can think of that would cause that is a .editorconfig file with a max_line_length configured
    Michael Rutter
    dammit! that is going to be it
    my CTO added a .editorconfig a while ago
    I kinda thought it was pointless because we use prettier and other formatters everywhere
    Jed Fox
    Yay, glad you got it figured out!
    Michael Rutter
    yep, he set it to 100
    I guess that is a feature request
    have something that lets you know its reading an .editorconfig file
    prettier --config-sources
    Jed Fox
    That’s definitely a bug — we should be returning .editorconfig files when you run prettier --find-config-path
    Hello, I'm building a side with based on gatsby's blog starter boiler plate. But when I try to format my jsx code (within js file) with prettier the language automatically switches to vanilla javascript. Is there any way to not to switch to vanilla javascript it? I have to switch back to jsx everytime :(
    Jed Fox
    Can you give an example of this happening in the playground? https://prettier.io/playground
    Hey folks, is there a way to configure prettier to respect custom CSS at-sign rules?
    Gabriel Rocheleau
    Hey guys. Is there an option to remove whitespaces in JSX classNames?
    E.g.: <span className=" text-gray-500 sm:text-sm sm:leading-5"> -> <span className="text-gray-500 sm:text-sm sm:leading-5">
    Joshua J Wilborn
    Hello, I'm having a very strange issue...we have a project using eslint + prettier, and I run the linting locally, everything passes...then in CI it fails. I already removed my ~/.eslintrc and ~/.prettierrc files in case they were causing the mismatch but that didn't work. What else might cause something like this?
    Torleif Berger
    In Markdown you should be able to add two spaces at the end of a line to get a forced line break, but Prettier seems to remove this in .mdx-files... is that a bug in Prettier? In the handling of Markdown files? MDX files? 😟
    Torleif Berger
    Could also be VS Code...
    Tony Dehnke

    Think I am seeing a prettier issue in a yaml file containing some ruby. How could I get this to pass?

    SyntaxError: Nested mappings are not allowed in compact mappings (18:13)
      16 |   # Your application name. Renaming here affects where data displays in New
      17 |   # Relic.  For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
    > 18 |   app_name: <%= ENV["SERVER_ENV"] == 'staging' ? '12vBiz (Staging)' : '12vBiz' %>

    this is in the config file tor NewRelic - newrelic.yml

    Tony Dehnke

    Sorry here is more of the error

          throw error;
    SyntaxError: Nested mappings are not allowed in compact mappings (19:13)
      17 |   # Relic.  For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
      18 |   # prettier-ignore
    > 19 |   app_name: <%= ENV["SERVER_ENV"] == 'staging' ? '12vBiz (Staging)' : '12vBiz' %>
         |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    > 20 | 
         | ^

    I tried adding the #prettier-ignore per the prettier docs, but that doesn't seem to work either.

    Portia Burton
    I would like to use prettier to correct common spelling errors. Does anyone know how I would go about doing that? I'm guessing I would create a regex rule in the config file, but I'm not sure how I would do that.
    Is there a way to format the ts code into the following style?
    Daniel Laubacher
    I can't seem to get prettier to work with trailing commas. Am I doing something wrong? Prettier keeps removing them.
    node v12.20.0
    I expected prettier to add the missing trailing comma, not remove the existing ones.
    Daniel Laubacher
    It seems that I misunderstood the rule, and trailing commas are only added when there are multiple lines.
    David Aurelio

    Hi. I am adding prettier to a repo and would like to use .eslintignore as ignores file. The problem is to make this frictionless for the dozens of developers working on it.

    While invoking the CLI is wrapped and --ignore-path set accordingly, providing this for editor integrations seems harder. I can’t use a symlink .prettierignore -> .eslintignore, because we also use windows, where git symlink support depends on local configuration. .prettierrc does not support ignorePath.

    Is there any way to provide my team with a no-config experience? Thanks.

    Alon Bukai
    Hey friends, who can I talk to about pushing this forward please?
    Matthew Adams
    It's Feb, 2021. What is the most minimal eslint & prettier TypeScript config to get all defaults, not have eslint or prettier conflict, and to work out of the box in WebStorm & VS Code so that I get eslint --fix & prettier --write on save or reformat? Please don't point me to https://prettier.io/docs/en/integrating-with-linters.html, because I'm ugly & dumb, and that page is confusing to me.
    Matthew Adams
    ^^^ @jlongster ?
    Matthew Adams
    Um, anyone? Bueller?
    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!
    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

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

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



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