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
Georgii Dolzhykov
5a33fec904
RFC: indentIfBreak ( #10221 )
2021-02-05 01:03:40 +02:00
Georgii Dolzhykov
575be32c05
Minor fixes in doc-debug
2021-02-04 13:42:47 +02:00
Georgii Dolzhykov and fisker Cheung
58173be8b8
docs: revise commands.md ( #10181 )
...
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-02-02 22:43:43 +02:00
Georgii Dolzhykov
62561039ac
Playground: show sidebar by default ( #10204 )
...
Show sidebar by default. Hide if window width < height (likely mobile)
2021-02-02 02:23:16 +02:00
Georgii Dolzhykov
56840d4890
Followup for #10169 : minor tweaks ( #10177 )
...
* Followup for #10169 : minor tweaks
* Add Copy doc button to Playground
2021-01-30 18:25:43 +02:00
Georgii Dolzhykov
78b38d2282
Round-trippable --debug-print-doc ( #10169 )
2021-01-29 21:48:34 +02:00
Georgii Dolzhykov
a7ea77e0ef
Fix regression after pr-10106 ( #10160 )
2021-01-29 19:58:24 +02:00
Georgii Dolzhykov
8846448b85
Handlebars: fix formatting of attributes ( #10145 )
...
* Handlebars: fix formatting of attributes
* Add group only for class
* Add changelog
* Update clean.js
* Simplify ConcatStatement
* Lowercase attr name in clean
* Use text instead of n.chars
2021-01-28 23:45:08 +02:00
Georgii Dolzhykov
b7a0e253f6
Fix changelog for #8233
2021-01-28 00:34:39 +02:00
Georgii Dolzhykov
53b59d2d39
Fix lineSuffixBoundary ( #10122 )
2021-01-28 00:29:34 +02:00
Georgii Dolzhykov
79d2f4a295
Add CLI flag for debugging comment attachment issues ( #10124 )
2021-01-27 12:30:10 +02:00
Georgii Dolzhykov
63a771db55
Add parallel-prettier to "Related Projects" ( #10147 )
2021-01-27 10:06:03 +02:00
Georgii Dolzhykov
1df287acc8
Use default parameters where possible and other microrefactoring ( #10135 )
2021-01-27 12:36:39 +08:00
Georgii Dolzhykov
343d372845
Document that Prettier never unquotes numeric properties in TS and Flow ( #10126 )
...
* Document that Prettier never unquotes numeric properties in TS and Flow
* Add Angular
* Mention Vue
2021-01-26 20:17:30 +02:00
Georgii Dolzhykov
c5484f7a0a
website: bigger font for <h5> in blog ( #10142 )
2021-01-26 18:56:42 +02:00
Georgii Dolzhykov
2b3716d527
Add skipped changelog entry to 2.2.0 blog post
2021-01-25 14:15:47 +02:00
Georgii Dolzhykov
24433cbbf6
Use fill to print number-only arrays ( #10106 )
2021-01-25 10:07:06 +02:00
Georgii Dolzhykov
f333c65231
Minor spellchecking and typechecking fixes ( #10125 )
2021-01-25 02:43:42 +02:00
Georgii Dolzhykov
2bb6cc4bf8
Fix webpack 5 CLI args in yarn start in website
2021-01-21 00:33:08 +02:00
Georgii Dolzhykov
af9478009e
copy rationale.md update to stable docs
2021-01-19 18:03:46 +02:00
Georgii Dolzhykov
4273cbf95f
docs: add a note on formatting reversibility ( #10062 )
2021-01-19 11:39:01 +02:00
Georgii Dolzhykov
0354b2ef9d
Add a test for HTML ( #10077 )
2021-01-18 16:40:57 +02:00
7cf524fa03
Smarter formatting of HTML class attribute ( #7865 )
...
* html: break class attr onto multiple lines, but try keeping consecutive classes with the same prefix on one line
* add changelog
* add more tests
* improve doc structure to fix an issue with the closing quote
* Update changelog_unreleased/html/pr-7865.md
Co-Authored-By: Jed Fox <git@twopointzero.us >
* handle classes with leading _ and -
* update snapshots
* Lint
* Update pr-7865.md
* Update changelog entry
Co-authored-by: Jed Fox <git@twopointzero.us >
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-01-18 15:50:52 +02:00
Georgii Dolzhykov
92cf9452e9
Disable Babel's error recovery for omitted call arguments ( #10065 )
2021-01-18 09:45:37 +02:00
Georgii Dolzhykov
1344d9a18a
Fix an oversight from #9709
2020-12-02 18:58:08 +02:00
Georgii Dolzhykov
c0e1179391
copy option philosophy to stable docs
2020-11-26 19:29:25 +02:00
Georgii Dolzhykov and Lucas Azzola
3a6d659ecc
Update option philosophy: option requests aren’t accepted anymore ( #8540 )
...
* Update option philosophy: option requests aren’t accepted anymore
* Update docs/option-philosophy.md
Co-authored-by: Lucas Azzola <lucas.azzola@iress.com >
* Update option-philosophy.md
Co-authored-by: Lucas Azzola <lucas.azzola@iress.com >
2020-11-26 19:19:40 +02:00
Georgii Dolzhykov
e721ef30ea
Flatten function expression parameters in hugged last argument ( #9662 )
...
Fixes #3376
This was done for arrow functions in #1305 ("Avoid breaking arguments for last arg expansion").
This PR enables the same for function expressions unless the function expression is the only argument.
2020-11-14 13:17:01 +02:00
Georgii Dolzhykov
d6858d52ad
Changelog edits for 2.2 ( #9603 )
2020-11-05 13:07:29 +09:00
Georgii Dolzhykov
633f084a76
LESS: fix comments in value lists ( #9356 )
2020-10-12 09:16:36 +08:00
Georgii Dolzhykov
fa04a5b464
Cleanup changelog_unreleased ( #9325 )
...
These were released in 2.1.2
2020-10-06 10:12:46 +09:00
Georgii Dolzhykov
488e08d70b
Remove the need to add full GitHub links in changelog entry titles ( #9104 )
2020-09-01 08:51:32 +08:00
Georgii Dolzhykov
c94d1bc014
update stable docs (plugins.md)
2020-08-30 22:08:56 +03:00
Georgii Dolzhykov
b42abbc99f
website: remove dependencies shared with root package.json ( #8618 )
2020-06-22 14:05:28 +03:00
Georgii Dolzhykov
e2e72154d6
Add a disclaimer about non-standard syntax ( #8613 )
2020-06-22 13:25:33 +03:00
Georgii Dolzhykov
3094ad5aa2
Fix unstable comments in binary expressions ( #8491 )
2020-06-05 09:55:22 +03:00
Georgii Dolzhykov
1df6838b0e
Revert #7787 ( #8495 )
2020-06-04 14:38:51 +03:00
Georgii Dolzhykov
5a0e33cc84
fix(range): improve detection of JS source elements ( #8419 )
...
* fix(range): improve detection of JS source elements
* Add changelog entry
* Remove unneeded comment
* Add more types and update snapshots
2020-05-29 07:29:09 +03:00
Georgii Dolzhykov
cf5d899d44
fix(typescript): remove now-unneeded workaround for directives ( #8422 )
...
* fix(typescript): remove unneeded workaround for directives
* Add changelog entry
2020-05-27 17:55:59 +03:00
Georgii Dolzhykov
81d7e06973
Fix range indentation ( #8410 )
2020-05-27 11:48:32 +03:00
Georgii Dolzhykov
7f2ba08fb0
refactor(range): minor cleanup ( #8421 )
2020-05-27 11:48:02 +03:00
Georgii Dolzhykov
67cbab7f48
Add plugins' parsers to the parser option ( #8390 )
...
* Add plugins' parsers to the `parser` option
* Add changelog entry
* Add plugin name to value description
* Update snapshot
2020-05-25 14:03:20 +03:00
Georgii Dolzhykov
47ed9a77e3
Add the browser and unpkg field to package.json ( #8387 )
2020-05-25 14:51:54 +08:00
Georgii Dolzhykov
d420202df4
fix(js): comments after superclass ( #8312 )
...
* Fix comments after superclass
* add changelog
* refactor
* Organize tests
* Use addBlockStatementFirstComment
* Amend unstableTests list
* Avoid identical comments in tests
* Add tests for `implements`
* Handle comments in interfaces
* Remove an always-false condition
* Almost a fix
* Further fixes
* Add DeclareClass
* Add DeclareInterface, mixins
* Fix extends in DeclareClass
* Fix DeclareClass
* Fix mixins
* Refactor: remove unused parameters
* Add marked dangling comments
* Unify printing of interface for TS and Flow
* Fix unstable interfaces
* Remove comment
* Restore the original behavior for interfaces with multiple inheritance
* Refactoring, tests
* Remove unused code
* Include a file accidentally omitted from the merge commit
* Remove unused type import
2020-05-24 21:53:29 +03:00
Georgii Dolzhykov
caeb367c16
Playground: autofold for Markdown and other languages ( #8331 )
2020-05-18 12:15:00 +03:00
Georgii Dolzhykov
c5ece64c21
Playground: fix how React is imported ( #8332 )
...
see https://twitter.com/sebmarkbage/status/1250284377138802689
2020-05-18 12:14:43 +03:00
Georgii Dolzhykov
382450172c
Playground: add Prettier version to document title ( #8333 )
2020-05-18 12:14:23 +03:00
Georgii Dolzhykov
5dcadf43ab
Fix babel-ts to emit a proper syntax error for (a:b) ( #8046 )
2020-05-16 02:48:45 +03:00
Georgii Dolzhykov
b1791e0def
refactor(css): calculate correct location data for value-* nodes ( #8266 )
...
* calculate correct loc for value-* nodes
* update clean.js to fix idempotence tests
2020-05-16 02:48:25 +03:00
Georgii Dolzhykov
a081bf812c
Close simple docs related issues ( #8289 )
...
* close #7805
* close #5571
* close #5121
* partially address #8094
2020-05-12 16:00:28 +03:00
Georgii Dolzhykov
dee69aa1bb
Add tests to close some issues - part 2 ( #8290 )
...
* tests for JSX comments, #1463
* add a test for #2761
* add a test for #3878
2020-05-12 14:29:37 +03:00
Georgii Dolzhykov
ddd6001520
Treat <select> and <optgroup> as inline-block for whitespace sensitivity ( #8275 )
2020-05-11 14:13:40 +03:00