Georgii Dolzhykov
2a70ee49a6
Fix leading comments in mapped types with readonly ( #13427 )
2022-09-06 11:55:11 +03:00
Georgii Dolzhykov
9cf3c09be9
Override version for the trim package to fix Markdown perf ( #13415 )
2022-09-04 09:08:42 +08:00
Georgii Dolzhykov
39a89c6519
Don't break signature of hugged function expression if parameters are identifiers without types ( #13410 )
2022-09-03 17:49:57 +03:00
Georgii Dolzhykov
a82a7e0233
Playground: press ctrl-q to generate a dummy id ( #13405 )
2022-09-01 23:20:56 +03:00
Georgii Dolzhykov
f5610b8510
Hug object types in function parameters in Flow like in TS ( #13396 )
2022-08-30 17:38:50 +03:00
Georgii Dolzhykov
41ff44e0c6
Refactor, optimize and fix call args expansion ( #13341 )
2022-08-29 14:37:09 +03:00
Georgii Dolzhykov
1ea5c993a0
Fix arrow chain indentation in calls and binaries ( #13391 )
2022-08-29 12:27:24 +03:00
Georgii Dolzhykov and fisker Cheung
c8ff3870c3
Refactor printObject ( #13393 )
...
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2022-08-28 22:47:31 +03:00
Georgii Dolzhykov
0e17e18893
Refactor isSimpleCallArgument ( #13359 )
...
Refactor isSimpleCallArgument and make it a bit stricter
2022-08-26 18:11:25 +03:00
Georgii Dolzhykov
05c873f09d
Playground: fix 'show doc', add folding for doc-explorer ( #13336 )
2022-08-22 09:25:18 +03:00
Georgii Dolzhykov
17081e6cf6
Support decorated function pattern ( #10714 )
2022-08-08 21:57:19 +03:00
Georgii Dolzhykov
67efa96da6
Custom parser API: deprecation notice ( #13252 )
2022-08-07 14:12:17 +03:00
Georgii Dolzhykov
21b4045dfa
Link option philosophy from the main page ( #13231 )
...
website: link Option Philosophy from the main page
2022-08-06 19:48:37 +03:00
Georgii Dolzhykov and fisker Cheung
4d5b645e0e
Support async parser for embedded languages ( #13211 )
...
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2022-08-07 00:45:06 +08:00
Georgii Dolzhykov and fisker
2c77149e6a
Add benchmark script ( #13224 )
...
Co-authored-by: fisker <lionkay@gmail.com >
2022-08-06 11:25:34 +08:00
Georgii Dolzhykov
bbbeeb07f6
Playground: "Rethrow embed errors" checkbox ( #13227 )
2022-08-05 17:05:50 +03:00
Georgii Dolzhykov
cd9955f143
Fix range format for function bodies ( #13173 )
2022-07-25 12:28:24 +03:00
Georgii Dolzhykov
b65cb6c1f6
Playground: doc explorer ( #10183 )
2022-07-23 22:46:16 +03:00
Georgii Dolzhykov
ab72a2c11c
Refactor: simplify fits ( #13154 )
2022-07-23 20:15:50 +08:00
Georgii Dolzhykov
20cc23ba35
Fix idempotence issues caused by eol comments after = in assignments ( #12349 )
2022-03-08 01:08:35 +08:00
Georgii Dolzhykov
542549c372
Refactor printing definite assignment assertions ( #12351 )
...
* Refactor printing definite assignment assertions
* Add changelog
* Fix unexpected ! in var initializers
2022-03-04 09:28:48 +09:00
Georgii Dolzhykov and sosukesuzuki
11e43e2e17
Avoid extra offset in arrow function body when using long types (alternative solution) ( #11515 )
...
* Avoid extra offset in arrow function body when using long types
* Rename var
* Handle object types properly
* Refactor, add test
* Don't try to keep arrow signatures on one line
Regression testing showed that this was a bad idea in this case
* Add changelog
* Break lhs if it's breakable and rhs is arrow fn
* Reuse isArrowFunctionVariableDeclarator
Co-authored-by: sosukesuzuki <aosukeke@gmail.com >
2021-11-17 16:24:16 +09:00
Georgii Dolzhykov
3616182508
Fix incorrectly wrapped arrow functions with return types ( #10940 )
2021-05-25 10:39:51 +03:00
Georgii Dolzhykov
8410e0db01
Update CONTRIBUTING.md
2021-05-21 12:58:21 +03:00
Georgii Dolzhykov
b84bc954e8
Update CONTRIBUTING.md
2021-05-20 23:59:32 +03:00
Georgii Dolzhykov
6dcc20c0fc
docs: make "A note on formatting reversibility" linkable
2021-05-20 23:40:45 +03:00
Georgii Dolzhykov
1005b4bca3
Update commands.md
2021-05-13 18:00:32 +03:00
Georgii Dolzhykov
4a8f5b81c1
Fix a link in the blog post
2021-05-10 19:08:49 +03:00
Georgii Dolzhykov
171b1ee2bf
Clean changelog_unlreleased
2021-05-10 00:17:59 +03:00
ba1a833378
Add 2.3 blog post ( #10659 )
...
* Start 2.3 blog post
* Apply suggestions from code review
Co-authored-by: Alex Rattray <rattray.alex@gmail.com >
* Regenerate the post
* Regenerate blog post
* Regenerate post
* Edit changelog entries
* Regenerate blog post
Co-authored-by: Alex Rattray <rattray.alex@gmail.com >
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-05-10 00:15:27 +03:00
Georgii Dolzhykov
06409b8bbf
Fix release script
2021-05-10 00:14:45 +03:00
Georgii Dolzhykov
e0610b0124
Update dependents count
2021-05-10 00:12:26 +03:00
Georgii Dolzhykov
f7de2925b1
Git blame ignore 2.3.0
2021-05-10 00:10:45 +03:00
Georgii Dolzhykov
3d8dc612b5
Bump Prettier dependency to 2.3.0
2021-05-10 00:07:47 +03:00
Georgii Dolzhykov
2afc3b9ae6
Release 2.3.0
2021-05-10 00:00:41 +03:00
Georgii Dolzhykov
66feb01960
docs: update git hooks instructions in install.md ( #10763 )
...
* docs: update git hooks instructions in install.md
* Add Yarn 2 link
2021-04-26 01:13:09 +03:00
Georgii Dolzhykov
4d4c0011b6
Edit changelog
2021-04-21 03:34:26 +03:00
Georgii Dolzhykov
c7b6116a45
Mark formatting improvements in changelog
2021-04-21 02:58:49 +03:00
Georgii Dolzhykov
08fb7af227
Mark formatting improvements in changelog
2021-04-21 02:45:44 +03:00
Georgii Dolzhykov
33cc92daad
Address more feedback in changelog entries
2021-04-21 02:05:22 +03:00
Georgii Dolzhykov
8588462f4b
Edit changelog entries (@j-f1's suggestions)
2021-04-20 23:48:06 +03:00
Georgii Dolzhykov
7630b4a2ad
Bump codecov/codecov-action to 1.4.1
2021-04-20 18:51:15 +03:00
Georgii Dolzhykov and fisker Cheung
bc90973cad
Avoid arg expansion that leads to broken code ( #10712 )
...
* Avoid arg expansion that leads to broken code
* Preserve new lines and only take comments into account if they break lines
* Add robustness against path state corruption due to throwing
* Refactor
* Remove redundant logic
It solved the same issue but only partially.
* Simplify further
* Refactor path.try, fix callParent issue
* Minor refactoring
* Add istanbul ignore comment
* Add return to AstPath#try
Co-authored-by: fisker Cheung <lionkay@gmail.com >
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-04-20 15:02:11 +03:00
Georgii Dolzhykov
88d765a4be
Edit changelog
2021-04-16 17:48:10 +03:00
Georgii Dolzhykov
1b2c72df10
TS: don't print parens around nested type assertions ( #10702 )
2021-04-15 00:19:42 +03:00
Georgii Dolzhykov
a610179132
Improve lone argument detection ( #10672 )
2021-04-15 00:19:23 +03:00
Georgii Dolzhykov
ae176f2e79
Process conditional groups in mapDoc ( #10695 )
2021-04-12 18:15:46 +03:00
Georgii Dolzhykov
22f9256faa
Edit changelog entries (JS)
2021-04-12 12:43:47 +03:00
Georgii Dolzhykov
97db2e3926
Minor refactoring of printObject ( #10696 )
2021-04-12 05:20:27 +03:00
Georgii Dolzhykov
641fe5e3a4
Changelog edits
2021-04-12 05:16:47 +03:00
Georgii Dolzhykov
e9f0a2b7c3
Dev package test: lock pnpm to pnpm@5 ( #10694 )
...
pnpm 6 dropped Node 10
2021-04-12 07:49:39 +08:00
Georgii Dolzhykov
1eaa8777a7
Mark changelog entries as highlights
2021-04-08 20:06:06 +03:00
Georgii Dolzhykov
7a5ccc581d
Tweak object destructuring in assignments ( #10643 )
2021-04-06 12:59:14 +03:00
Georgii Dolzhykov
4c9e4c7b81
Deduplicate yarn.lock
2021-04-05 04:38:02 +03:00
Georgii Dolzhykov
5f8bad8275
chore: add plugins to issue template
2021-03-27 23:04:55 +02:00
Georgii Dolzhykov
dfd471f334
Playground: autofold more AST properties ( #10596 )
2021-03-26 01:48:36 +02:00
Georgii Dolzhykov
45188c6396
docs: improve example for printer print function ( #10587 )
2021-03-24 18:09:09 +02:00
Georgii Dolzhykov
5624eaf87e
issue template: insist on using the Playground ( #7974 )
2021-03-16 18:31:36 +02:00
Georgii Dolzhykov
770ed280cf
Playground: serialize errors in AST ( #10548 )
2021-03-16 17:53:05 +02:00
Georgii Dolzhykov
13744dffa2
Fix edge case with trailing comments in arrow chains ( #10543 )
...
* Fix edge case with trailing comments in arrow chains
* Remove handling of args.needsSemi from printComments
2021-03-16 15:51:03 +02:00
Georgii Dolzhykov
68fd9db7d0
Fix Prettier 2.0 blog post
2021-03-16 15:05:15 +02:00
Georgii Dolzhykov
4fc2630c16
Remove stale plugins from home page and docs ( #10538 )
2021-03-15 03:54:59 +02:00
Georgii Dolzhykov
f7fe6f52ca
docs: refine browser.md ( #10539 )
2021-03-15 02:25:18 +02:00
Georgii Dolzhykov
6a87ce138a
Improve detection of AMD define ( #10528 )
2021-03-15 00:08:37 +02:00
Georgii Dolzhykov
2740ea6ee8
Avoid last-argument hugging for number-only arrays ( #10517 )
2021-03-14 12:15:53 +02:00
Georgii Dolzhykov
169faf39ac
Update yaml to 1.10.2 ( #10516 )
2021-03-14 12:14:08 +02:00
Georgii Dolzhykov
4ece300581
Fix Flow range formatting ( #10505 )
...
* Fix Flow range formatting
* Add changelog
2021-03-10 15:12:27 +02:00
Georgii Dolzhykov
33ab1fccc8
Clarify docs about pragma ( #10500 )
2021-03-10 03:40:15 +02:00
Georgii Dolzhykov
6be741d74e
Fix PR number in changelog
2021-03-10 03:02:43 +02:00
Georgii Dolzhykov
109492a497
Clarify prettier.format docs ( #10499 )
2021-03-10 02:54:50 +02:00
Georgii Dolzhykov
ceb7ee62f8
typechecking: remove @typescript-eslint/types from devDependencies ( #10470 )
...
@typescript-eslint/typescript-estree reexports these types.
2021-03-06 17:10:50 +02:00
Georgii Dolzhykov
37aa31e929
Remove hacks for single-element unions/intersections ( #10457 )
...
* Remove hacks for degenerate unions/intersection
* Add changelog
2021-03-04 01:21:03 +02:00
Georgii Dolzhykov and Sosuke Suzuki
5f8fee4d07
Prevent wrapping object properties with short keys ( #10335 )
...
* Prevent wrapping object properties with short keys
* Update src/language-js/print/assignment.js
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com >
* Use getStringWidth instead of .length
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com >
2021-03-03 01:43:46 +02:00
Georgii Dolzhykov
23b4822e66
Disable Jest's default transformer (Babel) ( #10454 )
...
* Disable Jest's default transform (Babel)
https://jestjs.io/docs/en/next/code-transformation#defaults
Otherwise, I sometimes get this error because Babel tries to resolve Browserslist:
----
● plugin search should not crash when prettier isn't inside a directory › encountered a declaration exception
ENOENT: no such file or directory, stat '/mnt/d/dev/prettier/tests_integration/mnt/d/dev/prettier/tests_integration/runPrettier.js'
52 | jest.spyOn(fs, "statSync").mockImplementation((filename) => {
53 | if (path.basename(filename) === "virtualDirectory") {
> 54 | return origStatSync(path.join(__dirname, __filename));
| ^
55 | }
56 | return origStatSync(filename);
57 | });
at Object.<anonymous> (tests_integration/runPrettier.js:54:14)
at isFile (node_modules/browserslist/node.js:38:42)
at eachParent (node_modules/browserslist/node.js:46:13)
at Object.getStat (node_modules/browserslist/node.js:197:15)
at browserslist (node_modules/browserslist/index.js:433:19)
at resolveTargets (node_modules/@babel/helper-compilation-targets/lib/index.js:174:46)
----
2021-03-01 13:55:20 +02:00
Georgii Dolzhykov
4a8fe3bc3c
Fix --debug-print-doc ( #10445 )
2021-02-28 20:52:57 +02:00
Georgii Dolzhykov
ff7a194e8a
Recreate yarn.lock
2021-02-28 18:49:56 +02:00
Georgii Dolzhykov
285c15ef08
docs: how to ignore files using negative patterns ( #10400 )
2021-02-24 21:47:07 +02:00
Georgii Dolzhykov
3dfdb2cff5
Add Support Requests bot config file ( #10387 )
2021-02-23 20:17:15 +02:00
Georgii Dolzhykov
ec27ade49b
Heuristic for grouping parameters in method signatures ( #10357 )
...
* Heuristic for grouping parameters in method signatures
* Apply the same logic to function declaration and Flow types
* Group only if there is only one parameter
* Don't group if type param has constraints/default or >1 type param
2021-02-23 16:38:56 +02:00
Georgii Dolzhykov
ca7c6fdec5
Add issue template config ( #10386 )
2021-02-22 16:45:02 +02:00
Georgii Dolzhykov
42f8271a1e
Indent type assertions in heads of call and member expressions ( #10341 )
2021-02-20 14:37:08 +02:00
Georgii Dolzhykov
31b3351800
Better formatting for nested await in member/call expression heads ( #10342 )
2021-02-20 12:50:44 +02:00
Georgii Dolzhykov
aef9277ada
Print trailing comma for TS type parameters but not type arguments ( #10353 )
2021-02-20 12:47:56 +02:00
Georgii Dolzhykov
e147c3b1c4
Fix ASI protection for private fields ( #10334 )
2021-02-18 12:39:56 +02:00
Georgii Dolzhykov
3950ce194d
Correct parentheses for non-null assertions ( #10337 )
2021-02-18 01:52:24 +02:00
Georgii Dolzhykov
0a647a0d31
Format assignments more consistently ( #10222 )
2021-02-16 21:25:11 +02:00
Georgii Dolzhykov
9a2dc517ad
Fix yarn.lock
2021-02-16 13:23:14 +02:00
Georgii Dolzhykov and fisker Cheung
2d1186995d
Refine CONTRIBUTING.md ( #10324 )
...
* Slightly refine CONTRIBUTING.md
* Write more about run_spec
* Wording
* Deeper tests is an advanced topic. Move to bottom
* Mention prettier-regression-testing
* Fix the type for snippets
* Typo
* Add 'Advanced topics' heading
* Fix run_spec types
* Minor edits
* Add link
* Wording around yarn fix
* Update CONTRIBUTING.md
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-02-16 08:56:32 +02:00
Georgii Dolzhykov
3a73f48a0e
Don't use smart quotes for JSON5 with --quote-props=preserve ( #10323 )
2021-02-15 19:13:33 +02:00
Georgii Dolzhykov
81e6208e63
Allow arg hugging for non-concise arrow functions with return type ( #10316 )
2021-02-15 19:13:09 +02:00
Georgii Dolzhykov
a322cf152a
Disable Babel error recovery for invalid escaped characters in identifiers ( #10322 )
2021-02-15 16:58:50 +02:00
Georgii Dolzhykov
7e8f746a4e
website: remove svgo ( #10315 )
2021-02-15 05:29:24 +02:00
Georgii Dolzhykov
ca4a51dcd9
build: fix tree shaking for front matter related functions ( #10314 )
2021-02-15 05:29:15 +02:00
Georgii Dolzhykov
8ba12c9d0d
website: remove js for removed elements
2021-02-15 02:09:07 +02:00
Georgii Dolzhykov
d3757fb6b4
website: add State of JS 2020 ( #10312 )
2021-02-15 00:22:08 +02:00
Georgii Dolzhykov
662cdb04db
RFC: label doc ( #10275 )
...
* RFC: label doc
* Update functions in doc-utils
2021-02-10 17:08:54 +02:00
Georgii Dolzhykov
f3906d84d4
Refactor: rename FastPath → AstPath ( #10276 )
2021-02-10 13:42:06 +02:00
Georgii Dolzhykov
a55fe2d961
Add tests for #2239 ( #10286 )
2021-02-10 01:06:14 +02:00
Georgii Dolzhykov
03a43ae55f
Fix error thrown on expressions like a(b => c => function (){}) ( #10278 )
2021-02-09 11:08:14 +02:00
Georgii Dolzhykov
0b5f259c08
Another minor fix in doc-debug
2021-02-06 14:41:02 +02:00