Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Keegan Saunders
    @meme
    hey, is there something like quoteProps: "as-needed", but for YAML ?
    I tried using it, but it doesn't seem to work. am I doing it wrong? is there an open issue for this? would be interested in working on this feature
    Christopher Kim
    @cswkim
    i’m using off the shelf prettier 2.0.5 with svelte…in my markup i’m getting an insert 2 spaces error for the following {#each $someVar as v} right at the dollar sign…does anyone know why that is raised?
    Andrew Leedham
    @AndrewLeedham
    Hi All. I am new to prettier development, trying to add @forward/@use scss support to language-css. But I am somewhat confused on how to structure a word and paren_group to be a separate group but not a function. See https://github.com/prettier/prettier/pull/7057#discussion_r477279472 If anyone can point me in the right direction, that would be much appreciated :)
    Artem Ilchenko
    @tema1411
    Hi All. Tell me plz. I have custom rules for import formatting with eslint, it is very important for me. Can I disable prettier import formatting?
    Ryan Zimmerman
    @RyanZim
    No, however, if your eslint formatting rules can auto-format, you can format with prettier, then have eslint format them back to the way you want them.
    Jon Harper
    @jonenst
    Hi, my google-fu has failed me. Does someone know how you get prettier to report each style error inside files ? Other tools I use work like this:
    [INFO] --- maven-checkstyle-plugin:3.1.0:check (default) 
    [INFO] Début de la vérification...
    [ERROR] Foo.java:15:22: ';' is preceded with whitespace. [NoWhitespaceBefore]
    [ERROR] Foo.java:17:12: Name 'GetVersion' must match pattern '^[a-z][a-zA-Z0-9]*$'. [MethodName]
    [...] other potential errors
    with prettier --check or --list-different, I only get the filename, not the actual style errors
    Ryan Zimmerman
    @RyanZim
    Pretter itself won't do that. eslint-plugin-prettier will.
    Though I'm curious why you want this, the entire point of prettier is that it auto-fixes your style.
    Jon Harper
    @jonenst
    Thanks for the pointers for eslint-plugin-prettier ! Do you have any links on how to use it with CRA ?
    I don't want prettier to write my files, I find it too intrusive. It can only write the whole file so it annoys me when prettier rewrites sections of the file that I didn't modify (because the file was not according to prettier beforehand)
    So I want to fix the mistakes myself, and hence want a list of mistakes to fix.
    Jon Harper
    @jonenst
    Thanks, I got eslint-plugin-prettier to work with cra: EXTEND_ESLINT=true and "extends": [
    "react-app",
    "plugin:prettier/recommended"
    ],
    in package.json eslintConfig
    using eslint-config-prettier
    Anyone knows how to make the prettier rules warn instead of error ? using
    "rules": { "prettier/prettier": "warn" }
    doesn't seem to work with CRA
    Jon Harper
    @jonenst
    Nvm, it works. Just have to rm -rf node_modules everytime the eslint configuration changes because of CRA
    Pac176
    @Pac176
    deseperate to have just a semicolon automaticly at end of line, try all and NEVER happened!!!!
    image.png
    Michael Rutter
    @m-rutter
    is there a way to get prettier to print the source of its configuaration based on default resolution?
    finding prettier is formatting very differently from the default (what we use), and running --no-conifg fixes the result to be what is expected
    Jed Fox
    @j-f1
    prettier --find-config-path ./my/file.js
    Michael Rutter
    @m-rutter

    ok, so is there a reason why

    prettier --write src and prettier --write src --no-config would produce different results when prettier --find-config-path src returns nothing

    Jed Fox
    @j-f1
    Can you try prettier --find-config-path on a path to a specific file? I’m not sure if it supports working with directories.
    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