Jed Fox
59720392c3
Add support for timeouts passed as integers to test functions ( #5085 )
...
* Add support for timeouts passed as integers to test functions
* ;
2018-09-13 06:08:47 -04:00
Ika
f7a6625d84
fix(typescript): no-semi for class props with modifiers ( #5083 )
2018-09-13 11:14:21 +08:00
Lucas Duailibe
b020a5606f
Keep simple JSXOpeningTag's unbroken ( #5078 )
2018-09-11 11:15:50 -03:00
Lucas Duailibe
c083300e9d
Fix debug doc printer for literalline
2018-09-10 13:14:55 -03:00
Ika
9ca10a378f
fix(typescript): add parens for complex nodes in ClassExpression ( #5074 )
2018-09-10 08:18:30 +08:00
Ernesto García
8283320648
Add Get on Board to list of users ( #5072 )
2018-09-08 19:55:32 -04:00
Ika
4ff0f26d3e
refactor: move cli leven suggestion to options-normalizer ( #5057 )
...
Option-related processing should be done in `options-normalizer`.
- unknown flag suggestions are colored
![image](https://user-images.githubusercontent.com/8341033/45103027-866c7900-b161-11e8-8ee3-6467a9ca0090.png )
- unknown flags with no suggestion are now errors:
```
$ bin/prettier.js --help noseminosemi
[error] Invalid `--help` value. Expected `a flag`, but received `"noseminosemi"`.
```
2018-09-08 07:40:09 +08:00
Yashu Mittal
3c77c5dcfb
Adding CodeCarrot to OCF list ( #5069 )
2018-09-08 07:38:03 +08:00
Ika
4d488e8b81
fix: no false positive for arrow function in jsx expression ( #5063 )
2018-09-07 09:39:59 +08:00
Lucas Duailibe
87376f93f3
Inline Generics with a single identifier ( #5066 )
2018-09-06 14:44:21 -03:00
Ika
1965b74e61
refactor: move index.js and standalone.js to src ( #5054 )
...
There're always 2 files that they're source code but not in the `src` directory, which makes it hard to search.
- move the content of `index.js` and `standalone.js` to `src`.
- `/index.js` and `/standalone.js` are preserved as links to not break builds that's installed from git.
2018-09-06 13:51:18 +08:00
Ika
461e6035c1
fix(typescript): preserve necessary parens for TSOptionalType ( #5056 )
2018-09-06 09:04:37 +08:00
Barbara He
ff4ef426e6
added link to style guideline benefits, fixed issue #4894 ( #5062 )
2018-09-05 16:11:24 -06:00
Ika
a1545a835a
feat(markdown): preserve math ( #5050 )
...
- preserve inlineMath (`$inline$`) and blockMath:
```md
$$
block
$$
```
- side effect: `$` always needs to be escaped.
2018-09-05 21:07:37 +08:00
Evilebot Tnawi
7fd346ffa1
feat: newline and space utils to shared ( #5049 )
2018-09-04 23:08:37 +03:00
Ika
50c9115632
feat: add printer.preprocess ( #5041 )
...
Sometimes we need to transform the ast to make it easier to print, but it's currently done in the parser (markdown and yaml), which leads the output ast harder to use for external users (custom parser), adding `printer.preprocess` can solve this issue.
And also this way we could move the trailing newline for json from `ast-to-doc.js` to `language-js`.
2018-09-03 23:27:50 +08:00
Eric Sakmar
6288704c41
format jest calls like regular calls ( #5011 )
2018-09-03 10:15:23 -03:00
Yulia Galuzo
0c7c1bfde4
fix: splitting jsx text correctly ( #5006 )
...
Fixes : #4941
2018-09-02 19:59:28 +02:00
Ika
91206891cd
fix(markdown): do not add whitespaces between Latin and Hangul ( #5040 )
...
Based on https://github.com/prettier/prettier/issues/5028#issuecomment-417825085 , it seems Korean text uses conventional space so we're not going to add whitespaces between Latin and Hangul.
2018-09-02 16:20:22 +08:00
Felix Wu
e86f08555a
Bugfix/ Don't inline pipeline operator with leading ownline comment ( #5015 )
...
* don't inline pipeline operator with leading ownline comment
* Add tests for comments surrounded with binary expressions
* Add babylon test for ownlinecomment with pipeline operator
2018-09-01 18:38:19 -04:00
Ika
db2bc3636d
fix(yaml): update parsers ( #5027 )
...
- upgrade to `yaml@1.0.0-rc.8` and `yaml-unist-parser@1.0.0-rc.4`
- refactor some logic since the AST has slightly changed (ikatyang/yaml-unist-parser#82 )
- unmatched aliases are now errors since it may introduce invalid AST from `yaml`
- rewrite the document separator (`...`/`---`) logic, this fixes some cases where it can use `---` but we printed `...`
- removed some unnecessary duplicate trailing newline
- trailing comments on `document` (`... #comment`) and `documentHead` (`--- #comment`) are preserved (i.e. they won't be moved somewhere)
2018-09-01 20:04:37 +08:00
Ika
165742014a
fix(markdown): preserve leading/trailing newlines in fenced code block ( #5038 )
2018-09-01 13:35:29 +08:00
Ika
4ce28d3ef4
fix(markdown): inline footnote def if there's only one 1-line paragraph ( #5025 )
2018-09-01 13:14:22 +08:00
Ika
669282e32a
fix(markdown): stably print lists in front of whitespace-only trailing newline ( #5024 )
2018-09-01 12:14:53 +08:00
Ika
55e620bdc7
chore: extract jest snapshot serializers ( #5034 )
2018-09-01 12:11:19 +08:00
Lipis
2e8366a84e
Update tools and dependent project numbers ( #5033 )
2018-08-31 10:52:37 +03:00
Ika
49e2f77bff
refactor: extract options-normalizer/validator ( #5020 )
...
- Uses [`vnopts`](https://github.com/ikatyang/vnopts#readme )
- This way it should be easier to support language-specific options (https://github.com/prettier/prettier/pull/4798#issuecomment-407258477 ) and map the common options to language-specific options using [`forward`](https://github.com/ikatyang/vnopts#forward ), e.g. `singleQuote: true` -> `"javascript/singleQuote": "js"`, `singleQuote: false` -> `"javascript/singleQuote": "none"`.
2018-08-31 11:26:07 +08:00
Ika
32390cd6a3
fix(vue): do not pass `<script src>` into multiparser ( #5031 )
2018-08-31 09:28:55 +08:00
Eric Sakmar
93e8b15311
verify the precedingNode type when handling import declaration comments ( #5016 )
2018-08-27 20:02:40 -06:00
Felix Wu
8779937a07
Bugfix/ Leave Dangle Comments in NewExpression ( #5017 )
...
```js
new Thing(/* comment */)
```
now stays the same instead of being formatted into
```js
new Thing /* comment */()
```
2018-08-27 09:23:14 +08:00
Ika
58d34bb844
refactor: language extend ( #4994 )
2018-08-22 10:12:57 +08:00
David
dda7c265d0
Update configuration to be clearer about js config ( #4993 )
...
So in the list, it says to use `prettier.config.js` as your file name for configuring prettier in js. But in the example it has `//.prettierrc.js`. This confused me so I tried both file names. Both these file names work to configure prettier so I updated the docs to reflect that.
2018-08-20 12:33:02 +08:00
Jed Fox
a687b9383b
Add a label that exempts issues from auto-locking ( #4987 )
...
* Add a label that exempts issues from auto-locking
* Exempt the “awaiting response” label so people can always reply and have their issue reopened
2018-08-19 07:33:20 -04:00
Malcolm Groves
d480858f01
Fix ternary format in function call ( #4368 )
...
* Fix ternary format in fn call
* Formatted to align with linter
* Update jsfmt.spec.js.snap
* Update jsfmt.spec.js.snap
* test: remove obsolete snapshot
2018-08-15 13:29:04 -04:00
Ika
1790211f76
feat: support MDX ( #4975 )
...
* feat: support MDX
* refactor: flip condition
2018-08-13 22:23:09 +08:00
TitanSnow
2de54dc4d8
remove redundant ASI protection for BindExpression ( #4970 )
2018-08-13 22:17:28 +08:00
Ika
6ba6138d09
feat(yaml): prefer implicit key for empty value ( #4972 )
...
* feat(yaml): prefer implicit key for empty value
* fix: prefer `?` for `!!set`
* refactor
2018-08-12 13:38:14 +08:00
Ika
82a12a58a8
fix(config): better error message for unsupported extension ( #4969 )
2018-08-11 16:35:18 +08:00
TitanSnow
b0a33b7326
fix #4963 : parens are incorrectly stripped in BindExpression ( #4964 )
...
* fix #4963
* lint code
* fix more incorrectly paren stripping
* always need parens when UnaryExpression in BindExpression
* lint code
2018-08-09 14:44:13 -03:00
Ika
26fd292ece
Bump Prettier dependency to 1.14.2
2018-08-09 11:05:58 +08:00
Ika
98cca8f66f
Release 1.14.2
2018-08-09 11:04:36 +08:00
Ika
53c83f97f5
fix: guess line ending before preprocess ( #4957 )
2018-08-09 10:51:08 +08:00
Ika
3842cbb118
fix(typescript): use the first error when both failed ( #4947 )
2018-08-09 10:21:00 +08:00
Ika
4fb2070244
Bump Prettier dependency to 1.14.1
2018-08-09 00:38:53 +08:00
Ika
35d0ff1d3f
Release 1.14.1
2018-08-09 00:36:36 +08:00
Ika
8973caf4bb
chore: improve release scripts ( #4933 )
...
- use the latest git tag as the previous version
- restore/bump the version on master in `bump-prettier.js`
- use `stdio: "inherit"` for `npm publish` so that we could input the OTP
- do not use `--runInBand` for local `test:dist`
- remove `Updating integration snapshots`
- remove `Attach all files in dist/ folder`
2018-08-08 23:49:22 +08:00
Ika
4d2f224919
fix(javascript): add parens for unary in bind ( #4950 )
...
* test: add tests
* fix(javascript): add parens for unary in bind
2018-08-08 23:48:12 +08:00
Ika
e72cb538f9
fix: update flow support info ( #4943 )
2018-08-08 23:47:49 +08:00
Adrian Leonhard
c83d5b15e7
Fix #4886 and add test. ( #4954 )
2018-08-08 09:24:25 -06:00
Brian Ng
1391891ef6
Print ObjectTypeInternalSlot with both flow/babel parsers ( #4869 )
...
* Print ObjectTypeInternalSlot with both flow/babel parsers
* chore: update to flow-parser@0.78.0
* test: update snapshot
2018-08-08 09:21:39 -06:00