profile
viewpoint
Prettier prettier https://prettier.io Prettier is an opinionated code formatter

startedprettier/prettier-vscode

started time in 10 minutes

issue commentprettier/prettier-vscode

Not formatting

Thanks, @klippx , that turned out to be my issue too!

derakhshanfar

comment created time in 35 minutes

startedprettier/prettier

started time in an hour

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha 0c492ed8a1fc01587f56cc8fdb7155d8a9dd12d9

Update changelog

view details

Christopher Quadflieg

commit sha 8fea70bdb11437e052224b6efddd5508bc4bfaf2

Use __vue_expression for vue attributes

view details

push time in 2 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Amazing work @Shinigami92 ! Thanks a lot

marlonmarcello

comment created time in 2 hours

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

Uh... That would work for attributes. But currently I'm working on text,
so there is no attribute key like v-* and so on.

I only have something like:

span {{ my.angular.value }} {{ someInputFromComponent | uppercase }}
Ulrikop

comment created time in 2 hours

delete branch prettier/plugin-pug

delete branch : issue-13

delete time in 3 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha cd149285d5192a323fc256f5f3cfb08cd4f2142f

Introduce new option attributeSeparator

view details

Christopher Quadflieg

commit sha b6fe788f88d09c56c4a2aa3f7e343ba2b61ea954

Extract options into own file

view details

Christopher Quadflieg

commit sha 4156d9e38fc7394939da36703e6edb82b20ba735

Add more test cases

view details

Christopher Quadflieg

commit sha ebf8590fd8fd6ec94bd4a825aef9ee559e9dab4e

Merge branch 'master' into issue-13

view details

Christopher Quadflieg

commit sha e0686b3f5db9dcf160ba7e5f1def0e9aeb02fb1d

Fix tests

view details

Christopher Quadflieg

commit sha 902df65b4bb8abe4f7086053272934b05784d6e7

Update changelog

view details

Shinigami

commit sha fb0131822cf4a54d10e6e263bdb27a8c9d33cfaf

Merge pull request #15 from prettier/issue-13 Introduce new option attributeSeparator

view details

push time in 3 hours

PR merged prettier/plugin-pug

Introduce new option attributeSeparator Angular Vue enhancement

closes #13

+176 -3

0 comment

9 changed files

Shinigami92

pr closed time in 3 hours

issue closedprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Hi @Shinigami92 ! As we previously talked on #11 I am making a feature request!

Looking through Pug's docs, they never use comma to separate the attributes on tags.

I think we should keep it consistent and have that same behaviour as default.

I, personally would remove the comma separation completely but I can see how it can be nice for other users, so I propose we make it an option.

The option could be called useCommaAttributes, or something similar, it would be a boolean that if set to true would have the parser add commas to separate the attributes on tags.

Thanks again, and please let me know your thoughts.

closed time in 3 hours

marlonmarcello

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha 902df65b4bb8abe4f7086053272934b05784d6e7

Update changelog

view details

push time in 3 hours

startedprettier/vim-prettier

started time in 3 hours

fork git38438/prettier

Prettier is an opinionated code formatter.

https://prettier.io

fork in 3 hours

startedprettier/prettier

started time in 3 hours

issue openedprettier/prettier

union type array breaks after opening parenthesis, but not before closing

Prettier 1.18.2 Playground link

--parser typescript

Input:

const arr = [abc, def, ghi, jkl, mno, pqr, stu, vwx, yz] as (string | undefined)[];

Output:

const arr = [abc, def, ghi, jkl, mno, pqr, stu, vwx, yz] as (
  | string
  | undefined)[];

Expected behavior: Up for debate, maybe simply

const arr = [abc, def, ghi, jkl, mno, pqr, stu, vwx, yz] as (
  | string
  | undefined
)[];

Also not sure if it's the best place to break first.

somewhat similar to https://github.com/prettier/prettier/issues/3403

created time in 3 hours

issue openedprettier/prettier

TypeScript + JSX (TSX): required trailing commas are stripped from type parameters

<!--

BEFORE SUBMITTING AN ISSUE:

  1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, you do not need to open a new issue — please add a 👍 reaction to the existing issue instead.

  2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. This means we have a very high bar for adding new options. Find out more: https://prettier.io/docs/en/option-philosophy.html

Tip! Don't write this stuff manually.

  1. Go to https://prettier.io/playground
  2. Paste your code and set options
  3. Press the "Report issue" button in the lower right

-->

Prettier 1.18.2 Playground link

Input:

const fn = <T,>(t: T) => t;

Output: This is invalid syntax for a .tsx file. TypeScript needs the comma because without it, the syntax is ambiguous.

const fn = <T>(t: T) => t;
  • https://github.com/Microsoft/TypeScript/issues/15713#issuecomment-499474386
  • https://stackoverflow.com/questions/32308370/what-is-the-syntax-for-typescript-arrow-functions-with-generics#comment99104831_45576880

Expected behavior:

const fn = <T,>(t: T) => t;

created time in 3 hours

issue commentprettier/plugin-php

Prettier crashes on comments in a multiline if condition

Thanks for issue, feel free to send a PR

lmichelin

comment created time in 3 hours

issue openedprettier/plugin-php

Prettier crashes on comments in a multiline if condition

@prettier/plugin-php v0.11.2 Playground link

Input:

<?php

if ($bool0
    || $bool1 // if condition 1
    || $bool2 // if condition 2
  ) {
    $ok = true;
}

Output:

Comment "// if condition 1" was not printed. Please report this error!

created time in 3 hours

issue openedprettier/prettier-vscode

There is no document formatter for 'javascriptreact'-files installed.

I've tried restarting VS Code and reinstalling the plugin to no avail. It worked consistently up until today and I've changed nothing in regards to my setup since then. All settings are pretty much default for the plugin too except for tab spacing.

created time in 3 hours

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

But it seams that __vue_expression use the babel-parser.

More precisely, the babel expression parser. Though they use the same parser, their |s are printed differently, | is printed as a filter in vue but a bitwise OR in js.

I also don't know how to assume whether it is using vue or angular. I could introduce an option for framework, but I think that is not really smart 😕 Do you have an example for testing? So a vue and an anguar snippet that are formatted differently?

IIRC, they are formatted in the same way, the only difference between them is that they support different grammars. I guess you could try to guess which parser to use based on attribute names next to it (vue: v-*, :*, @*, etc.; angular: [*], (*), [(*)], etc.), and try another parser if the parsing failed, just like what typescript parser did.

Ulrikop

comment created time in 3 hours

delete branch prettier/plugin-ruby

delete branch : ternary-parens

delete time in 3 hours

push eventprettier/plugin-ruby

Kevin Deisz

commit sha 14b5e94288c4b441add37a05bcce32aea4765857

Add parens on ternary operators when needed

view details

Kevin Deisz

commit sha 31dba9f763e5bedcc6cc2af7e767bed25dd3f23c

Add @jviney as a contributor

view details

Kevin Deisz

commit sha 263748c06d76198ab5a5ec465811f2d15313bf3d

Merge pull request #345 from prettier/ternary-parens Add parens on ternary operators when needed

view details

push time in 3 hours

PR merged prettier/plugin-ruby

Add parens on ternary operators when needed

Fixes #342

+80 -9

0 comment

6 changed files

kddeisz

pr closed time in 3 hours

issue closedprettier/plugin-ruby

if/else/end.foo outputs incorrect code using the ternary operator

Metadata

  • Ruby version: 2.6.3
  • @prettier/plugin-ruby version: master@240c279

Input

if true
  foo
else
  bar
end.join

Current output

true ? foo : bar.join

Expected output

Needs to at least preserve the original code's behaviour. Possibly shouldn't convert if/else/end.foo to a ternary.

(true ? foo : bar).join

closed time in 3 hours

jviney

issue commentprettier/plugin-ruby

Converting conditional to inline version breaks when returning new variable

Oh boy. This is a good one. Not entirely sure what I want to do here. I think I may have to just make it so that if there's an assignment inside the conditional that we automatically break.

jviney

comment created time in 3 hours

issue commentprettier/plugin-ruby

if/else/end.foo outputs incorrect code using the ternary operator

Thanks @jviney - that'll go out in the next release

jviney

comment created time in 4 hours

PR opened prettier/plugin-ruby

Add parens on ternary operators when needed

Fixes #342

+80 -9

0 comment

6 changed files

pr created time in 4 hours

push eventprettier/plugin-ruby

Kevin Deisz

commit sha 31dba9f763e5bedcc6cc2af7e767bed25dd3f23c

Add @jviney as a contributor

view details

push time in 4 hours

create barnchprettier/plugin-ruby

branch : ternary-parens

created branch time in 4 hours

startedprettier/plugin-php

started time in 4 hours

startedprettier/eslint-config-prettier

started time in 4 hours

issue openedprettier/vim-prettier

Window is unexpectedly scrolled after :Prettier

Do you want to request a feature or report a bug? Bug

What is the current/expected behavior? Steps to reproduce:

  1. Open any JavaScript file that is big enough to be vertically scrollable.
  2. Add an empty line to the end of a buffer. (actually, other edits also cause this issue but new lines at the ending are easier to reproduce)
  3. Set the cursor position at the last (empty) line.
  4. :vs
  5. :PrettierAsync or :Prettier
  6. Inactive window to the right will be scrolled to the very bottom so that there will be only one visible line of code the screen (see the screenshot).

What version of vim-prettier are you using - (output of :PrettierVersion) ? 0.2.7 Actually, a similar issue occurs in the 'release/1.x' a cursor in an inactive window jumps to the beginning of the buffer.

What version of prettier are you using - (output of :PrettierCliVersion) ? 1.17.1

What is your prettier executable path - (output of :PrettierCliPath) ? /home/user/p/introversion/node_modules/.bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ? It didn't work in my experience.

:ver
NVIM v0.3.1
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0/x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DMIN_LOG_LEVEL=3 -Wall -
Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE
_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_UNIBI_HAS_VAR_FROM -I/var/tmp/portage/app-editors/neovim-0.3.1/work/neovim-0.3.1_build/config -I/var/tmp/portage/app-editors/neovim
-0.3.1/work/neovim-0.3.1/src -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.3.1/work/neovim-0.3.1_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.3.1/work/n
eovim-0.3.1_build/include
Compiled by root@cuckoo

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "/etc/vim/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

screenshot_15:44_2019-07-16-label

created time in 4 hours

startedprettier/eslint-config-prettier

started time in 5 hours

issue closedprettier/eslint-config-prettier

Turn off lines-between-class-members

https://eslint.org/docs/rules/lines-between-class-members

Just noticed a bunch line breaks added when updating some other eslint plugins (standard) that recently added this rule. I believe line breaks are a prettier concern?

closed time in 5 hours

gpoitch

issue commentprettier/eslint-config-prettier

Turn off lines-between-class-members

You're correct, allows either. Thanks. https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgGIQQ7AA6UOO0cAFAJTFkUWM4C+LMA7hHQ+Uy3b8OACwBOcGvVL9m-IXIoAzCAFcxOALw5emgHzEFOJQEsAbnC076+wyxaYTADyu6DwIUJAAaEBAAOMCbQmMig6GJiEJwAChEIoSjoZhAmACY+IABGYuhgANZwMADK-nkmUADmyDBiqnC+IjAAtqgA6iIm8JhlYHDFCV3mXQCeyODYmRWYcGIwMbmVzejISuioM74AVphOAEK5BUXF6M1wADIVcKvrmyA7TsUVlahwAIqqEPA3Gw0gZWIZmJxll0Fk4KhMv4xBUYG10jARMgABwABl80IgMzauX842hcCBFkyAEdPvAFgFEiAsABaKCSNJwDK+CRkkwSBboJYrJBrX6+GbNEw1Op-RxVV4fL7XPm3P4wMHwtKI5AAJl8tXQJlQzwAwhBmstxlAqJlVDMACpgxL8masVhAA

gpoitch

comment created time in 5 hours

startedprettier/eslint-config-prettier

started time in 5 hours

issue commentprettier/eslint-config-prettier

Turn off lines-between-class-members

I believe Prettier allows either version, so it should be up to users whether or not to enable this rule.

gpoitch

comment created time in 5 hours

startedprettier/plugin-ruby

started time in 6 hours

startedprettier/vim-prettier

started time in 6 hours

startedprettier/prettier-eslint

started time in 7 hours

startedprettier/plugin-php

started time in 8 hours

startedprettier/prettier

started time in 8 hours

startedprettier/prettier

started time in 9 hours

startedprettier/prettier

started time in 10 hours

issue closedprettier/prettier

Typescript Union Types Formatting Issue

Prettier 1.18.2 Playground link

Input:

export type AllTypes = 
  TypeOne | 
  TypeTwo |
  TypeThree | 
  TypeFour | 
  TypeFive | 
  TypeSix;

Output:

export type AllTypes =
  | TypeOne
  | TypeTwo
  | TypeThree
  | TypeFour
  | TypeFive
  | TypeSix;

Expected behavior: The Prettier's output is weird. Because the first element of code is undefined. But when I hover my mouse over the variable it shows: type AllTypes = TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix (correct).

When I take the output of prettier and remove all linebreaks, you will get this:

export type AllTypes = | TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix;

No TypeScript or Linter errors. I just wondering, is this allowed? Can I use pipes before OR after? I expected the same as my input.

export type AllTypes = TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix;

Maybe this is a tolerated format of TypeScript. Because it ignores the empty expression before the first pipe. - I'm confused. Maybe this is a unwanted behavior?

Maybe it should be:

export type AllTypes =
  TypeOne
  | TypeTwo
  | TypeThree
  | TypeFour
  | TypeFive
  | TypeSix;

I think the current output of prettier looks "prettier". But it's maybe not correct. I though the first element is undefined. Like declaring an array [, 1, 2, 3, 4, 5]. The first is empty / undefined. Do you know what I mean?

closed time in 10 hours

Domvel

issue commentprettier/prettier

Typescript Union Types Formatting Issue

Ok, thanks for the informations. Leading pipes are ignored for formatting reasons. But maybe this should be an option.

Domvel

comment created time in 10 hours

startedprettier/prettier

started time in 10 hours

fork hahtml/prettier

Prettier is an opinionated code formatter.

https://prettier.io

fork in 10 hours

issue commentprettier/prettier-vscode

Typescript React - can't find scoped modules

I had the same issue - setting "prettier.eslintIntegration" to false solves it.

Through VSCode bring up settings menu and search for "eslintIntegration", then untick the "Prettier: Eslint Integration" field.

TidyIQ

comment created time in 11 hours

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

@ikatyang Nice to know that there are so many internal things I didn't noticed ^^' I only see the typescript .d.ts definitions and use them as docu and learn how to use prettier

So I will try that. But it seams that __vue_expression use the babel-parser.

I also don't know how to assume whether it is using vue or angular. I could introduce an option for framework, but I think that is not really smart 😕

Do you have an example for testing? So a vue and an anguar snippet that are formatted differently?

Ulrikop

comment created time in 11 hours

startedprettier/plugin-php

started time in 12 hours

delete branch prettier/plugin-php

delete branch : dependabot/npm_and_yarn/eslint-plugin-jest-22.7.2

delete time in 13 hours

PR closed prettier/plugin-php

chore(deps-dev): Bump eslint-plugin-jest from 22.4.1 to 22.7.2 dependencies

Bumps eslint-plugin-jest from 22.4.1 to 22.7.2. <details> <summary>Release notes</summary>

Sourced from eslint-plugin-jest's releases.

v22.7.2

22.7.2 (2019-07-04)

Bug Fixes

  • add missing schemas so rule config is properly validated (#291) (e901d03)

v22.7.1

22.7.1 (2019-06-22)

Bug Fixes

  • add defined guards to util functions (#285) (9cba626)

v22.7.0

22.7.0 (2019-06-20)

Features

  • config: added shareable configuration jest/all (#276) (d7a9532)

v22.6.4

22.6.4 (2019-05-22)

Bug Fixes

  • add-no-commented-out: correct false positives (#271) (1740ee7)

v22.6.3

22.6.3 (2019-05-22)

Bug Fixes

v22.6.2

22.6.2 (2019-05-22)

Bug Fixes

v22.6.1

22.6.1 (2019-05-22)

</tr></table> ... (truncated) </details> <details> <summary>Commits</summary>

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it). To ignore the version in this PR you can just close it
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

+5 -5

1 comment

2 changed files

dependabot-preview[bot]

pr closed time in 13 hours

pull request commentprettier/plugin-php

chore(deps-dev): Bump eslint-plugin-jest from 22.4.1 to 22.7.2

Superseded by #1091.

dependabot-preview[bot]

comment created time in 13 hours

PR opened prettier/plugin-php

chore(deps-dev): Bump eslint-plugin-jest from 22.4.1 to 22.8.0

Bumps eslint-plugin-jest from 22.4.1 to 22.8.0. <details> <summary>Release notes</summary>

Sourced from eslint-plugin-jest's releases.

v22.8.0

22.8.0 (2019-07-15)

Features

v22.7.2

22.7.2 (2019-07-04)

Bug Fixes

  • add missing schemas so rule config is properly validated (#291) (e901d03)

v22.7.1

22.7.1 (2019-06-22)

Bug Fixes

  • add defined guards to util functions (#285) (9cba626)

v22.7.0

22.7.0 (2019-06-20)

Features

  • config: added shareable configuration jest/all (#276) (d7a9532)

v22.6.4

22.6.4 (2019-05-22)

Bug Fixes

  • add-no-commented-out: correct false positives (#271) (1740ee7)

v22.6.3

22.6.3 (2019-05-22)

Bug Fixes

v22.6.2

22.6.2 (2019-05-22)

</tr></table> ... (truncated) </details> <details> <summary>Commits</summary>

  • e292cb8 chore: refresh lockfile (#300)
  • dd4bbaf feat(rules): no-duplicate-hooks (#298)
  • a3a6dca chore(docs): fix up eslint logo (#299)
  • e901d03 fix: add missing schemas so rule config is properly validated (#291)
  • 9cba626 fix: add defined guards to util functions (#285)
  • d7a9532 feat(config): added shareable configuration jest/all (#276)
  • 3bb50dc chore: use messageId in all rules (#278)
  • 75c9773 chore: bump dated deps (#277)
  • 1740ee7 fix(add-no-commented-out): correct false positives (#271)
  • 1ce1402 fix: revert TypeScript migration
  • Additional commits viewable in compare view </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it). To ignore the version in this PR you can just close it
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

+5 -5

0 comment

2 changed files

pr created time in 13 hours

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

Their grammars are different, you should use __vue_expression if you'd like to parse vue's {{expression}}.

Ulrikop

comment created time in 14 hours

startedprettier/prettier

started time in 14 hours

startedprettier/eslint-plugin-prettier

started time in 16 hours

startedprettier/prettier

started time in 16 hours

pull request commentprettier/prettier-vscode

feat: update prettier-eslint to 9.0.0

It's literally just yarn.lock that's failing, I'm dying here losing in-editor formatting

zyy7259

comment created time in 16 hours

fork Ocean-August/prettier

Prettier is an opinionated code formatter.

https://prettier.io

fork in 16 hours

startedprettier/prettier

started time in 16 hours

startedprettier/prettier

started time in 17 hours

startedprettier/prettier

started time in 17 hours

startedprettier/prettier

started time in 17 hours

startedprettier/prettier

started time in 17 hours

startedprettier/prettier

started time in 17 hours

startedprettier/prettier

started time in 17 hours

PR opened prettier/prettier

JavaScript: Fix bug when arrow fn as function parameter with newline

<!-- Please provide a brief summary of your changes: --> Fix #6294

// Input
foo(
  ({
    a,

    b
  }) => {}
);

// Output (Prettier stable)
foo(({ a,
  b }) => {});

// Output (Prettier master)
foo(
  ({
    a,

    b
  }) => {}
);

<!-- Please ensure you’ve done all of these things (if applicable). --> <!-- You can replace the [ ] with [x] to mark each task as done. -->

  • [x] I’ve added tests to confirm my change works.
  • [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • [x] (If the change is user-facing) I’ve added my changes to the CHANGELOG.unreleased.md file following the template.
  • [x] I’ve read the contributing guidelines.

Try the playground for this PR

+289 -0

0 comment

4 changed files

pr created time in 18 hours

issue commentprettier/prettier

Codes format unexpected with function "pipe"

I'm having this problem too (playground):

stream.pipe(dest, { end: false })

Is changed to:

stream.pipe(
  dest,
  { end: false }
)
yutent

comment created time in 19 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

OK ... it works ... ^^ ' But I don't want to publish it right now, because I'm not satisfied with the current output I think it needs to format more, like the array should be [1, 2, 3, 4, 5, 6] and so on It's too late, I'll work on it tomorrow when I have time

If you want, you can clone the repo, use yarn link, test the issue-13-branch, and then give more feedback if something is not like you expected

marlonmarcello

comment created time in 21 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha e0686b3f5db9dcf160ba7e5f1def0e9aeb02fb1d

Fix tests

view details

push time in 21 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha 4a0d84f07114082d4958962d1bb3dfe6eb384d32

Handle &attributes token

view details

Christopher Quadflieg

commit sha ebf8590fd8fd6ec94bd4a825aef9ee559e9dab4e

Merge branch 'master' into issue-13

view details

push time in 21 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha 4a0d84f07114082d4958962d1bb3dfe6eb384d32

Handle &attributes token

view details

push time in 21 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha 4156d9e38fc7394939da36703e6edb82b20ba735

Add more test cases

view details

push time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Yeah, it's a special case.

marlonmarcello

comment created time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

... Have to handle &attributes, but in another branch

marlonmarcello

comment created time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

I don't think it should be, the PUG compiler will deal with that, because for example, if you set your doctype to doctype html when you pass false to an attribute like data-nav=false pug will remove that attribute from the final HTML file. So I think we should let the compiler decide.

This is the anchor mixin

mixin anchor({ href, isExternal })
  if !isExternal
    - href = `${LOCALE_ROOT}/${href}`
  a(
    href=`${href}`
  )&attributes(attributes)
    if block
      block
marlonmarcello

comment created time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Um... Should data-nav=true be shortened to data-nav?

Can you give me also the mixin to anchor?

marlonmarcello

comment created time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Oh man. To be fair, on the first example it's a mix of commas and not commas, I feel like that is a job for a linter to fix? What do you think?

Some examples:

Multi line attributes:

nav-component(
  locale-relative-redirect="true"
  highlight="home"
  pin="false"
)```

Mixin plus attributes:

+anchor({ href: "contact/"}).extra-class(data-popup="true")


Variable attributes:

.wrapper(data-nav=true data-next="Next" data-prev="Prev" data-slides=4 data-arr=[1,2,3,4,5,6] data-obj={att: 1, attr2: 2})

marlonmarcello

comment created time in 21 hours

push eventprettier/plugin-pug

Christopher Quadflieg

commit sha b6fe788f88d09c56c4a2aa3f7e343ba2b61ea954

Extract options into own file

view details

push time in 21 hours

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

Please give me some examples, so I can add it to the tests

marlonmarcello

comment created time in a day

PR opened prettier/plugin-pug

Introduce new option attributeSeparator Angular Vue enhancement

closes #13

+102 -3

0 comment

7 changed files

pr created time in a day

issue commentprettier/prettier

format yaml front matter

Could you please share a link to Prettier Playground where you issue is reproduced?

tomderudder

comment created time in a day

create barnchprettier/plugin-pug

branch : issue-13

created branch time in a day

issue commentprettier/plugin-pug

Feature Request: Make the separation of attributes with a comma an option

@marlonmarcello Currently working on this feature. Would like to let you know that I have found a DANGEROUS 🚨 example

hello-framework([name]="name" [version]="version", (release)="onVersionRelease()")
// converts to
<hello-framework [name]="version" (release)="onVersionRelease()"></hello-framework>

Note the merged vesrion into name

hello-framework([name]="name", [version]="version", (release)="onVersionRelease()")
// converts to
<hello-framework [name]="name", [version]="version", (release)="onVersionRelease()"></hello-framework>
marlonmarcello

comment created time in a day

issue openedprettier/prettier

format yaml front matter

format yaml front matter don't work properly with array

---
title: Quelle est ta classe / ton niveau ?
levels:
- name: 4 ème
  id: 1
---

created time in a day

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

Yea, checked it at stackblitz.com. Angular doesn't support template strings in html 😌 But Vue does!

Ulrikop

comment created time in a day

issue commentprettier/plugin-pug

Bug: Apostrophes are destroyed inside of angulars interpolation

It looks like the Angular parser doesn’t support template strings :(

Prettier 1.18.2 Playground link

--parser __ng_interpolation

Input:

foo(`hello`) 

Output:

o@https://prettier.io/lib/parser-angular.js:1:43190
parseNgInterpolation@https://prettier.io/lib/parser-angular.js:1:44300
n@https://prettier.io/lib/parser-angular.js:1:54797
parse@https://prettier.io/lib/parser-angular.js:1:55428
parse$2@https://prettier.io/lib/standalone.js:12947:24
coreFormat@https://prettier.io/lib/standalone.js:16216:28
format@https://prettier.io/lib/standalone.js:16476:83
format@https://prettier.io/lib/standalone.js:31000:28
formatCode@https://prettier.io/worker.js:234:27
handleMessage@https://prettier.io/worker.js:185:28
onmessage@https://prettier.io/worker.js:155:27
Ulrikop

comment created time in a day

startedprettier/vim-prettier

started time in a day

issue openedprettier/prettier-atom

Uncaught TypeError: Cannot read property 'version' of undefined

[Enter steps to reproduce:]

  1. cmd+shift+p
  2. Prettier: debug

Atom: 1.38.2 x64 Electron: 2.0.18 OS: Mac OS X 10.14.5 Thrown From: prettier-atom package 0.57.0

Stack Trace

Uncaught TypeError: Cannot read property 'version' of undefined

At /Users/psenders/.atom/packages/prettier-atom/dist/displayDebugInfo/index.js:27

TypeError: Cannot read property 'version' of undefined
    at getDebugInfo (/packages/prettier-atom/dist/displayDebugInfo/index.js:27:51)
    at HTMLElement.displayDebugInfo (/packages/prettier-atom/dist/displayDebugInfo/index.js:36:11)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:348418)
    at Object.didConfirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:697714)
    at SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:871573)
    at HTMLDivElement.core:confirm (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:866452)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:348418)
    at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1247210)
    at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1243344)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:283624)

Commands

     -0:28.4.0 snippets:next-tab-stop (input.hidden-input)
     -0:28.4.0 snippets:expand (input.hidden-input)
     -0:28.4.0 editor:indent (input.hidden-input)
  2x -0:27.3.0 core:backspace (input.hidden-input)
     -0:25.5.0 core:save (input.hidden-input)
     -0:21.5.0 editor:newline (input.hidden-input)
     -0:20.8.0 core:save (input.hidden-input)
     -0:12.1.0 command-palette:toggle (input.hidden-input)
     -0:11.1.0 core:move-down (input.hidden-input)
     -0:10.9.0 core:confirm (input.hidden-input)
     -0:10.9.0 prettier:format (input.hidden-input)
     -0:09.4.0 command-palette:toggle (input.hidden-input)
     -0:08.3.0 core:move-down (input.hidden-input)
     -0:08.0 core:move-up (input.hidden-input)
     -0:07.7.0 core:confirm (input.hidden-input)
     -0:07.7.0 prettier:debug (input.hidden-input)

Non-Core Packages

goto-definition 1.3.4 
linter 2.3.0 
prettier-atom 0.57.0 

created time in a day

issue commentprettier/prettier

Typescript Union Types Formatting Issue

This is a feature of the typescript grammar.

Related typescript issue: https://github.com/Microsoft/TypeScript/issues/12071

Domvel

comment created time in a day

issue commentprettier/prettier

Typescript Union Types Formatting Issue

If you want undefined, use

export type AllTypes = undefined | TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix;

// or better
export type AllTypes = TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix | undefined;

// or even better
export type AllTypes = TypeOne | TypeTwo | TypeThree | TypeFour | TypeFive | TypeSix;
const type: AllTypes | undefined;

I think this is working as intended -> can be closed

Domvel

comment created time in a day

issue commentprettier/prettier

[TypeScript] Trailing commas from type exports removed

Anyone managed to fix this? Eslint is complaining about the missing comma that prettier removes.

SimenB

comment created time in a day

startedprettier/prettier

started time in a day

issue commentprettier/prettier

Typescript Union Types Formatting Issue

This is valid Typescript syntax (and Flow, fwiw). Both | (union) and & (difference) operators are allowed at the front and end of the line, and the location makes no difference to the generated type.

Domvel

comment created time in a day

more