Commit Graph
2027 Commits
Author SHA1 Message Date
fisker Cheung 17377f3082 Split css parsers (#7932)
* Split css parsers

* pass function to parseWithParser

* Fix plugins parser

* Fix coverage fails

* coverage ignore

* Update project coverage target to 95%
2020-04-03 12:41:48 +08:00
fisker Cheung bcf99ade8d Fix angular unstable expression binding (#7924) 2020-04-02 20:20:28 +03:00
fisker Cheung 93aa37867e Update isSCSS test regex (#7922) 2020-04-02 15:51:48 +03:00
fisker Cheung 22e3004719 Fix empty file format (#7921) 2020-04-02 00:43:52 +03:00
fisker Cheung e199e68bff Format script content inside HTML tag with colon (#7916)
* Format script content inside HTML tag with colon

* Fix mistake
2020-04-01 20:35:58 +03:00
Dmitry Gonchar 964230dce2 Fix #7920 - do not add comma for explicit inexact object with indexer property (#7923)
* 7920 run tests for trailingComma:es5 option as well

* 7920 example of wrong behavior - comma is always added at the end of the inexact object type

* 7920 add test cases for trailingComma: 'all'

* 7920 fix - do not force trailing comma on explicit inexact type if it has indexer or no properties

* 7920 add changelog
2020-04-01 15:24:45 +03:00
Georgii Dolzhykov 2d1142fc30 Use scss parser for css-in-js (#7883) 2020-03-31 17:10:38 +03:00
Sosuke Suzuki 0f56b4aa62 Flow: Print dangling comments for empty inexact object type (#7892)
* Remove unnecessary group

* Print dangling comment for inexact type

* Add changelog

* Fix changelog
2020-03-31 20:26:16 +09:00
Sosuke SuzukiandGeorgii Dolzhykov 8a48ca2e3d [TypeScript] format TSAsExpression with same logic as BinaryExpression (#7869)
* Treat TSAsExpression as like BinaryishNode

* Change test file extension, as.js => as.ts

* Add tests

* Remove old case for TSAsExpression

* Remove unnecesary condition

* Fix by lint

* Update snapshots

* Add changelog

* Remove convetToBinaryishNode

* Fix comment

* Use getBinaryishNodeNames

* Modify to wrap TSAsExpression with parens

* Fix by lint

* Do not pass operator when node is TSAsExpression

* Refactor shouldNotIndent

* Update util.js

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-31 20:25:47 +09:00
Kevin Gibbons 18bf01e8f8 Fix bug with holes in array literals (#7911) 2020-03-31 12:43:19 +03:00
fisker Cheung b0ffc0f1df Fix prettier-ignore inside JSX (#7877) 2020-03-26 20:10:05 +02:00
fisker Cheung 77e3fc0d41 Fix ignored element print (#7867)
* Fix ignored element print

* Add changelog
2020-03-25 15:54:39 +03:00
Sosuke Suzuki 30adb17173 Modify to use isBinaryish (#7848) 2020-03-24 11:57:10 +02:00
Georgii Dolzhykov 58ac3b0c15 Revert "markdown: fix redundant leading spaces in markdown list" (#7847) 2020-03-23 22:47:36 +02:00
Georgii Dolzhykov 8ec7bc229a fix formatting of pseudo-elements and pseudo-classes in styled-components (#7842) 2020-03-23 16:59:49 +02:00
Georgii Dolzhykov ba500e22f9 Refactor inferParser to extract interpreter only once (#7835) 2020-03-23 03:33:53 +02:00
Georgii Dolzhykov 996d1cbb4f Add please-upgrade-node (#7837) 2020-03-23 03:32:05 +02:00
Kevin Gibbons 209b1f7749 TypeScript: avoid trailing commas on index signatures with only one parameter (#7836) 2020-03-23 02:22:20 +02:00
Georgii Dolzhykov 6835aa8dda fix prettier-ignore in union types (#7798) 2020-03-23 00:51:40 +02:00
dependabot-preview[bot]andGeorgii Dolzhykov 6257951386 Bump linguist-languages from 7.8.0 to 7.9.0 (#7809)
* Bump linguist-languages from 7.8.0 to 7.9.0

Bumps [linguist-languages](https://github.com/ikatyang/linguist-languages) from 7.8.0 to 7.9.0.
- [Release notes](https://github.com/ikatyang/linguist-languages/releases)
- [Commits](https://github.com/ikatyang/linguist-languages/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* ignore yarn.lock

* update snapshots

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-22 22:57:12 +02:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +02:00
Evilebot TnawiandGeorgii Dolzhykov 4602bb6b95 refactor css comments (#7021)
* refactor css comments

* workarounds for postcss-less location bugs

* improve replaceQuotesInInlineComments

* update changelog

* fix comments in selectors

* fix comments in values

* use \ufffe instead of \0 because that's what these characters are for

see http://www.unicode.org/faq/private_use.html#nonchar6

* fix quoted urls

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-20 18:09:07 +02:00
Georgii Dolzhykov 1ad13d7420 Ultimate fix for Closure-style type casts (#7791) 2020-03-19 18:26:22 +02:00
fisker Cheung aacb5fa75f Fix vue attributes indention (#7781) 2020-03-17 22:30:24 +02:00
Sosuke Suzuki 9d9e46c8c5 Support TypeScript 3.8 export * as ns syntax (#7764) 2020-03-17 02:43:15 +02:00
Georgii Dolzhykov 3f1c46373a Expand directories in CLI (2020) (#7660) 2020-03-17 01:34:32 +02:00
Georgii Dolzhykov 318bf2cb33 Partial support for TypeScript 3.8 (private fields, import/export type modifier) (#7631)
* support TypeScript 3.8

* Update standard_private_fields.ts

* improve tests for import/export type modifier

* temporary hacks for private fields

* comment out some tests, update snapshots

* add changelog entry
2020-03-11 17:40:57 +03:00
Sosuke Suzuki f8692f3bde TypeScript: Print dangling comment in empty type parameters (#7729)
* Modify to print dangling comment in type parameters

* Add changelog

* Fix changelog

* Modify to support line comment

* Fix changelog

* Change line to hardline
2020-03-10 17:33:33 +03:00
Sosuke Suzuki 78fe9cab73 JavaScript: Keep comments position for assignment/variable (#7709) 2020-03-10 11:37:42 +02:00
fisker Cheung acff41e7c9 Update postcss-less to v3 (#6981) 2020-03-10 01:14:34 +02:00
fisker Cheung 31c5798e59 Memoize loadPlugins (#7485) 2020-02-27 16:43:02 +02:00
Mahir Shah 7cd82068bd Preserve Whitespace Control For Handlebars (#7575)
Previously whitespace strip characters ("~") were omitted after prettier
transformation on handlebars templates becuause the glimmer AST parser
did not expose when whitespace strip characters were used.

Update to the latest glimmer parser which exposes strip flags indicating
when whitespace strip characters are present. Update the glimmer printer
to preserve whitespace strip characters.
2020-02-27 11:50:14 +09:00
Georgii Dolzhykov 1f64401915 remove --stdin (#7668) 2020-02-27 02:19:52 +02:00
Georgii Dolzhykov d469140322 exclude another debug path from coverage 2020-02-26 21:08:27 +02:00
Graeme Worthy 7f2b103cf6 Support <!-- prettier ignore --> for text (#7654) 2020-02-25 13:11:08 +02:00
Shinigami 59e15ec744 Use spread syntax (convert to es2015) (#6317) 2020-02-25 03:05:49 +02:00
fisker Cheung 129fcb6005 Remove resolve package (#7508) 2020-02-25 03:03:58 +02:00
Georgii Dolzhykov 78784871e8 exclude a debug path from coverage 2020-02-25 02:09:47 +02:00
fisker Cheung 04012b9dc7 Remove --flow-parser/useFlowParser (#7511) 2020-02-24 19:30:12 +02:00
fisker Cheung 6515a7ebe9 Remove deprecated options (#7536) 2020-02-24 18:58:32 +02:00
fisker Cheung fc8218b5a6 Remove postcss parser (#7535) 2020-02-24 18:58:16 +02:00
fisker Cheung b3f0102a87 Remove babylon parser (#7533)
* Remove `babylon`

* Add changelog

* Fix website files
2020-02-24 18:19:03 +02:00
Georgii Dolzhykov cf3d9f0b80 api: remove the version parameter of getSupportInfo (#7620)
* api: remove the version parameter of getSupportInfo

* add changelog entry

* remove mapDeprecated

* Update pr-7620.md

* remove the first parameter completely

* Update api.md

* add default value for opts just to be on the safe side
2020-02-23 02:47:17 +02:00
Karl Horky 2b761b6af8 Remove unnecessary expression (#7648)
Since wordPart is checked for falsiness on the previous line, it will always evaluate to an empty string. The expression in the parentheses will then evaluate to `"" || ""`, which I assume is not desired.

Ref: https://lgtm.com/projects/g/prettier/prettier/snapshot/ecfc5e9b8320d79ed8a801d811e0a63892b040d0/files/src/printer-postcss.js?sort=name&dir=ASC&mode=heatmap#L468
2020-02-21 00:54:15 +02:00
fisker Cheung 647c041b57 Check pattern existence before glob (#7587) 2020-02-19 12:57:39 +02:00
fisker CheungandChristopher J. Brody 3cef19c73e Update globby to v11 (#6776)
* globby@10 update (with fast-glob implementation)

with some minor test snapshot updates in tests_integration since
fast-glob does not always keep the same file order as node-glob

* with no `nodir: true` option

use of no `nodir: true` option was introduced in 639c52388
but it does not seem to be needed with some newer
versions of globby

* with workaround for fast-glob on Windows

ref: https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows

Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: Christopher J. Brody <chris@brody.consulting>

* Revert "with no `nodir: true` option"

This reverts commit f7297cbceebc3d939bca0d90a904a1d3fea45345.

* revert updates to snapshots in tests_integration

* sort the file paths from globby

and update some snapshots in tests_integration

* Update build scripts

* replace `util.promisify` with `pify`

* style

* typo

* add pify to dict

* check index.js

* debug

* exclude `transform-async-to-generator`

* fix `bin-prettier.js`

* restore disabled script

* try depth:1

* remove depth add `./`

* sort dir

* disable expandDirectories

ref: https://github.com/sindresorhus/globby/blob/master/index.js#L95

* use absolute path

* remove sort()

* sort dir

* use `alphasorti` compare

* remove './'

* fix `findPluginsInNodeModules`

* fix `findPluginsInNodeModules`

* restore snap

* fix `findPluginsInNodeModules`

* return early

* code style

* sort

* update snap

* try mem

* mem `loadPlugins` function

* fix

* glob directories instead of package.json

* use deep

* remove mem

* improve speed

* support dot pattern

* expand directories test

* restore import order

* remove snap

* update test

* restore `findPluginsInNodeModules`

* Update `globby`

* `fast-glob` beta

* Restore logic

* Add tests for `globby` update

* Fix tests

* Remove option with default value

* Try new beta version of `fast-glob`

* Restore error info

* Add `path.sep` check
2020-02-18 17:36:22 +02:00
Kevin GibbonsandGeorgii Dolzhykov ada3d08df5 Put space after generator star, not before (#7516)
* Put space after generator star, not before

* remove pr-7516.md, edit pr-3903.md instead

Because the release blog post will be generated from these files.

* edit pr-3903.md

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-18 16:27:52 +02:00
Corinne Hoener 50e0ea91ee Respect prettierignore when executed in subdirectories (#7588)
* Respect prettierignore when executed in subdirectories

* Add ignore-in-subdirectories tests

* Add changelog entry
2020-02-18 00:40:26 +02:00
Georgii Dolzhykov 16c0a7a10f Rudimentary support for the most used directives of AngularJS 1.x (#6869)
* Rudimentary support for the most used directives of AngularJS 1.x

* add ng-class and ng-style

* add changelog entry in the new format

* Update pr-6869.md

* update snapshots
2020-02-18 00:38:23 +02:00
fisker Cheung ee61bdf435 Remove usage of cosmiconfig v4 interface (#7458)
* Remove usage of cosmiconfig v4 interface

* Remove `loadEditorConfig` second argument
2020-02-17 16:42:04 +02:00