Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Michael Rutter
    @m-rutter
    nothing
    because I don't have a config file in the project
    Jed Fox
    @j-f1
    huh, that’s weird
    Michael Rutter
    @m-rutter
    we have never had one
    but suddenly we are getting lots more noise in our commits from prettier
    Jed Fox
    @j-f1
    I usually make a config file containing just {} to tell editor integrations I’m using Prettier and to make sure there aren’t any other configs being taken into account
    Michael Rutter
    @m-rutter
    and investagating I've found that --no-config produces the result we had previously
    investigating*
    that does not appear to make a difference
    adding a prettierrc file with {}
    it reports that that file is the config file
    but --no-config produces a completely different result
    --no-config only changes the files we have worked on in the last 3 weeks, but without it all of our files get formatted differently
    Jed Fox
    @j-f1
    ok, another thing you can check is node -p 'require("prettier").resolveConfig.sync("./src")' which will print out the config it thinks it’s seeing
    Michael Rutter
    @m-rutter
    ❯ node -p 'require("prettier").resolveConfig.sync("./src")'
    {}
    I really don't trust this result
    Jed Fox
    @j-f1
    ah, it looks like that needs to be passed an explicit file path
    Michael Rutter
    @m-rutter
    ❯ node -p 'require("prettier").resolveConfig.sync("./src/logging.ts")'
    {}
    and if I take one of the file that have been formatted without the --no-config flag
    and paste it into the online editor on the website
    it formats it as if it were --no-config
    I'm very confused
    Jed Fox
    @j-f1
    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
    @m-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
    @m-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
    @j-f1
    the only thing I can think of that would cause that is a .editorconfig file with a max_line_length configured
    Michael Rutter
    @m-rutter
    dammit! that is going to be it
    my CTO added a .editorconfig a while ago
    aahhhhhhhhhhh
    I kinda thought it was pointless because we use prettier and other formatters everywhere
    Jed Fox
    @j-f1
    Yay, glad you got it figured out!
    Michael Rutter
    @m-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
    @j-f1
    That’s definitely a bug — we should be returning .editorconfig files when you run prettier --find-config-path
    Korhan
    @Lapin
    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
    @j-f1
    Can you give an example of this happening in the playground? https://prettier.io/playground
    Ghost
    @ghost~5513273a15522ed4b3ddd30e
    Hey folks, is there a way to configure prettier to respect custom CSS at-sign rules?
    Gabriel Rocheleau
    @gabrocheleau
    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
    @JoshuaJWilborn
    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
    @Svish
    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
    @Svish
    Could also be VS Code...
    Tony Dehnke
    @tonydehnke_twitter

    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
    @tonydehnke_twitter

    Sorry here is more of the error

    /node_modules/prettier/index.js:13588
          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.