Commit Graph

1250 Commits (bc027bd661e466e2eb25733bbe2549589ca646c8)

Author SHA1 Message Date
Evilebot Tnawi bc027bd661
fix(css): space after `if` in `else` at rule (#3921) 2018-02-07 19:53:28 +03:00
Evilebot Tnawi 0e1358b5ca
Improve the printing of CSS at-rules (#3896)
fix(css): improve at rules print
2018-02-07 13:33:10 +03:00
Evilebot Tnawi 9e6bd15ade
fix(css): comments in selectors (#3909) 2018-02-07 13:20:13 +03:00
Evilebot Tnawi 1b13dc8974
fix(css): declaration comments (#3897) 2018-02-06 18:09:42 +03:00
Lipis 125868c083
Remove commented out code (#3886) 2018-02-05 22:59:38 +01:00
Evilebot Tnawi ebf83a9138
refactor(printer-postcss): use `node` name and implement helper functions (#3893) 2018-02-05 16:42:32 +03:00
Evilebot Tnawi ed2a9be58e
fix(css): stringify unquoted data urls (#3877) 2018-02-02 20:39:53 +03:00
Evilebot Tnawi f5e74cd70a
fix(css): at rules improve formatting and tests (#3828) 2018-02-02 18:06:47 +03:00
Lucas Duailibe aac38fca49 Force break if comment in return argument (#3665)
* Force break if comment in return argument

* add test case
2018-01-31 12:00:29 -05:00
Evilebot Tnawi ed5f68844f
fix(css): scss `global` flag (#3844) 2018-01-30 17:53:37 +03:00
Evilebot Tnawi 22ba2bcb64
fix(css): don't remove semicolon in `less` ruleset declaration (#3841) 2018-01-30 14:16:07 +03:00
Salem 8c792121f2 Treat define calls like require (#3830)
* Treat define calls like require

See issue #3829. This commit keeps define calls as a unit when possible,
to prevent an extra indent in the body of an AMD-style define.

Rather than adding the "define" check in the same case as the existing
"require" check, I added a separate condition to explicitly call out the
fact that this checks for both AMD and CommonJS modules.

`yarn test -u` yields no changes, and `yarn lint` passes successfully.

* Added tests for define and require amd formatting

This tests the solution for issue #3829.

* Add babylon interpreter to require-amd test

* Merge require and define checks
2018-01-29 16:44:32 -05:00
Ika 84c603623d
feat: support external options (#3775)
* refactor: wrap

* refactor: replace

* refactor: replace

* refactor: replace

* refactor: extract

* refactor: logger

* refactor

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* feat(support): add `showInternal` option

* refactor: use internal

* refactor

* refactor: extract

* refactor: extract

* refactor

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: reorder

* refactor: remove unnecessary

* refactor: reorder

* refactor: move

* refactor

* refactor

* refactor

* refactor: remove unnecessary

* feat: external options from CLI

* refactor: push/pop plugins

* feat: external options from config file

* refactor: remove unnecessary

* refactor

* refactor

* refactor

* fix: use `json-stable-stringify`

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: move

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: extract

* refactor: move

* refactor: extract

* docs: add comments

* refactor: sort

* refactor: sort

* refactor: rename

* refactor: remove unnecessary

* style: remove trailing whitespace
2018-01-28 00:24:25 +08:00
Ika b529c634d1
fix(markdown): print multiline content correctly in footnoteDefinition (#3787)
* fix(markdown): print multiline content correctly in footnoteDefinition

* refactor: replace `ifBreak(line)` with `softline`

* refactor: fix linting
2018-01-27 00:48:47 +08:00
Evilebot Tnawi e3369db2c1
fix(css): handle namespace in attribute selector (#3810) 2018-01-26 13:00:20 +03:00
Ika 03292a6488
fix(javascript): ternary with `--use-tabs` (#3745)
* test: add test cases

* test: add test cases

* fix(javascript): ternary with `--use-tabs`

* chore: add istanbul ignore comment

* fix: remove unnecessary condition

* docs(commands): update `align`

* fix: do not transform the middle part

* refactor: markAsRoot

* fix: print tabs in sub-ternaries

* docs(commands): update

* test: add a cool test case
2018-01-26 10:02:42 +08:00
Evilebot Tnawi a3bf378259
fix: handle YAML front matter block (#3802) 2018-01-24 19:44:09 +03:00
Evilebot Tnawi 5008836dc2
fix(css): remove whitespaces before ":" in scss maps (#3814) 2018-01-24 18:48:54 +03:00
Evilebot Tnawi 4c90608d11
fix: keep space between deep selector `>>>` (#3792) 2018-01-24 14:53:22 +03:00
Evilebot Tnawi 7797c93489
fix(css): ignore `media` params with scss interpolation (#3801) 2018-01-24 12:31:30 +03:00
Evilebot Tnawi d3004b51ea
feat: remove extra spaces in `url` inside `@import` (#3793) 2018-01-23 23:33:19 +03:00
Evilebot Tnawi fc200c9432
fix(css): remove other types of whitespace in `clean` (#3799) 2018-01-23 20:57:23 +03:00
Brian Ng a8fb1863a2
Merge pull request #3797 from prettier/feat-css-lowercase-wide-keywords
feat(css): lowercase wide keywords
2018-01-23 09:33:01 -06:00
Evilebot Tnawi b2e8c6d374 feat: remove extra spaces in attribute selector (#3794) 2018-01-23 10:30:20 -05:00
evilebottnawi 591ee5a425 feat(css): lowercase wide keywords 2018-01-23 18:10:39 +03:00
Evilebot Tnawi 105914e45c fix: don't handle args of `@warn` and `@error` directives as media query list (#3769) 2018-01-19 17:00:06 -07:00
Evilebot Tnawi 12441eb2dd fix: don't add comma after `url` in `@import` directive (#3770) 2018-01-19 16:56:28 -07:00
Evilebot Tnawi 74d25c37f0 fix: don't change case of function name (#3768) 2018-01-19 15:39:44 +01:00
Ika dc26445e51
refactor(options): use supportOptions to generate CLI options (#3622)
* refactor(cli-constant): use supportOptions

* refactor(options): use supportOptions

* refactor(cli-util): use supportOptions

* fix: do not infer parser in multiparser

* chore: remove unnecessary package

* chore: trigger another travis build

* test: add kebab-case test to ensure no regression

* test: update snapshots
2018-01-18 15:26:27 +08:00
wonderful-panda 3f788d4fb6 fix: *.vue with `lang='tsx'` is not formatted (#3763) 2018-01-18 00:20:55 -02:00
Ika de6bc4448f
fix(multiparser): respect 0-indent markdown-in-js (#3676)
* fix(multiparser): respect 0-indent markdown-in-js

* fix: use literalline for 0-indent

* test: add unexpected case

* fix: 0-indent

* test: add failing test

* refactor: simplify

* fix(doc): literallines respect `ind.root`

* docs: update commands

* fix: what a magic...
2018-01-17 12:52:42 +08:00
Ika 2dd311d554
fix(javascript): indentation for sub-ternaries (#3747)
* test: add test cases

* test: add test cases

* fix(javascript): indentation for sub-ternaries

* test: update test cases

* fix: no extra tab for `tabWidth: 4`
2018-01-16 11:32:25 +08:00
Evilebot Tnawi 64f1c06727 fix(scss/less): space after combinator operator (#3738) 2018-01-13 13:17:29 -02:00
Thorben von Hacht 1a1de60491 Prettier extends and implements when not fitting in same line (#3689)
* Added prettier layout for class extends and implements

* Added prettier layout for class extends and implements, fix with keeping it in online if it fits

* Added prettier layout for class extends and implements, fixed tests as a side change

* Extends implements comments in same line fix

* Extends implements comments in same line without ugly workaround

* added empty line to test typescript_class/extends_implements.ts

* If only one extends keep old behaviour

* Removed console logs
2018-01-13 16:31:51 +11:00
Quinn Hoyer aa0437cc60 Add support for skip() (#3706) (#3735)
* Add support for skip() (#3706)

* Fix regex & add tests
2018-01-13 13:02:31 +11:00
Evilebot Tnawi 934f679705 fix(scss): `!default` directive (#3724) 2018-01-12 22:12:02 +11:00
Daniel Heckrath 2155465c88 Enable PostCSS in VUE SFC (#3715)
* Enable PostCSS in VUE SFC

* Add test that verifies that postcss style blocks are parsed

* Move postcss check to same condition as the css check
2018-01-12 17:05:22 +11:00
Aleks Hudochenkov b67fd8e155 Don't add end of line to empty CSS (#3723)
Fixes #3440.
2018-01-11 16:05:57 -05:00
Lucas Duailibe 46baad09cd
Fix vue print error with self-closing tags (#3705) 2018-01-10 17:41:11 -02:00
Lucas Azzola cf511ec2e9 1.10.1 2018-01-10 23:39:06 +11:00
Ika 3df7d60a7f feat(markdown): respect `tabWidth` for list indentation (#3694)
* test: add test case

* feat(markdown): respect `tabWidth` for list indentation

* test: add extreme `tabWidth` test case
2018-01-10 18:45:22 +11:00
Lucas Azzola b1a7787e87
Fix vue self-closing tags (#3693) 2018-01-10 18:44:18 +11:00
Marcel Jackwerth a27d19b2c1 Allow Plugins to preprocess text (#3664)
* Allow Plugins to preprocess text

* Actually pull up text

* Always expect the preprocessor to set the text

* Add tests for preprocessing

* Remove unused variable
2018-01-10 00:27:26 +11:00
Lucas Duailibe 01a59eeee3
Wrap conditionals and await in parens in spread property (#3681) 2018-01-09 01:45:51 -02:00
Lucas Azzola e5d6a4704f
Automatically load plugins from package.json (#3624)
* Automatically load plugins from package.json

* Fix build by adding json extension

* Fixup misuse of options argument

* Rewire graceful-fs to fs

* Document graceful-fs issue

* Alias graceful-fs to fs in Rollup
2018-01-05 21:09:51 +11:00
Christopher Chedeau a4dd86436a
[scss] Print comments inside of selector as is (#3649)
Fixes #3647
2018-01-04 19:03:04 -08:00
Lucas Duailibe 7f75499dd2 Prevent adding softline after arrow attribute with comments (#3641)
* failing test

* fix
2018-01-03 12:12:01 -08:00
Lucas Duailibe 157df6e3fd
Print imageReference with no alt in Markdown (#3643) 2018-01-03 13:54:53 -03:00
Lucas Duailibe 7d3a30615b
Don't add () in JSX attributes with elements (#3640) 2018-01-03 11:36:25 -03:00
Marcel Jackwerth 6260629f18 [Plugins] Allow custom getCommentChildNodes (#3639)
* [Plugins] Allow plugins to specify their own getChildNodes for comment printing

* Rename getChildNodes -> getCommentChildNodes
2018-01-03 23:58:53 +11:00