Commit Graph

398 Commits (f94f63b040f881e182c0ffe5efcf7ba3e1053090)

Author SHA1 Message Date
Ika f94f63b040
chore: update azure pipelines (#5611)
- upload coverage report (codecov) from azure pipelines
- only build `dist` once (`dist` is now shared between production jobs)
- run production tests on macOS (not sure why but it's faster than others)
- extract shareable steps
- remove travis/circle
2018-12-18 08:16:32 +08:00
mattia richetto 031f6e860f Update string-width to support emoji natively (#5646)
the `string-width` package v3 now supports emoji width https://github.com/sindresorhus/string-width/pull/17
2018-12-18 08:13:12 +08:00
Brian Ng 8e612f05a0
Add support for class private methods (#5637) 2018-12-14 09:45:26 -06:00
Ika ffc8482458
fix(vue): tag names are case-sensitive (#5606) 2018-12-13 10:31:48 +08:00
Ika 952bc0cc03
fix: get rid of CRLF (#5494) 2018-12-08 18:28:29 +08:00
Ika 525c076be8 Bump Prettier dependency to 1.15.3 2018-11-30 10:30:52 +08:00
Ika a5ccfa1ecb Release 1.15.3 2018-11-30 10:29:15 +08:00
Ika 3cd1d003c0
fix(typescript): do not throw errors on bigint keyword (#5577)
- fix `Error: unknown type: "TSBigIntKeyword"`
- bump typescript to stable version
2018-11-30 10:12:32 +08:00
Ika 28b938da97
feat(html): update angular-html-parser (#5565)
- support [`htm`](https://github.com/developit/htm) (`<${Component}>content<//>`, `<div />`)
- preserve [bogus comments](https://www.w3.org/TR/html5/syntax.html#bogus-comment-state) (`<! ... >`, `<? ... >`)
2018-11-29 11:03:22 +08:00
Wei-Wei Wu c28dc2f19c Updating cosmiconfig to not cache .js config files when told not to (#5558) 2018-11-29 09:49:33 +08:00
Ika bd3834010c
chore(build): es5 compatibility for browser (#5560) 2018-11-28 12:52:05 +08:00
Ika 05ad885c3c
feat(typescript): support BigInt (#5546) 2018-11-27 16:53:34 +08:00
Ika 99a3efaa7a
fix: update editorconfig-to-prettier (#5550) 2018-11-26 13:08:52 +08:00
Ika a50a8e258c
fix(javascript): upgrade @babel/parser to 7.1.6 (#5530) 2018-11-24 21:47:47 +08:00
Evilebot Tnawi e588533e16
chore(deps): update `postcss-scss` (#5481)
* chore(deps): update `postcss-scss`

* chore: trigger build
2018-11-15 17:23:26 +03:00
Ika 5726df774e Bump Prettier dependency to 1.15.2 2018-11-11 01:10:29 +08:00
Ika 4b2d8c1b5f Release 1.15.2 2018-11-11 01:08:51 +08:00
Ika 6fafd0a48d
fix(angular): correctly print unary expression with `+` (#5405) 2018-11-10 01:01:18 +08:00
Ika 7f472d72ae
fix(angular): handle parens in ng expression correctly (#5387) 2018-11-09 00:06:16 +08:00
Ika 306cce5b10 Bump Prettier dependency to 1.15.1 2018-11-07 10:21:18 +08:00
Ika b11391d238 Release 1.15.1 2018-11-07 10:19:27 +08:00
Ika 514b6d3741 Bump Prettier dependency to 1.15.0 2018-11-07 09:12:25 +08:00
Ika 4559a774bb Release 1.15.0 2018-11-07 09:07:53 +08:00
Brian Ng e882452c54 Bump @babel/parser (#5356)
Follows #5304 with flow inexact support in @babel/parser!
2018-11-07 08:42:11 +08:00
Alexander Kachkaev b87fe4cf22 Add option to enforce certain line endings (#5327) 2018-11-06 22:47:13 +08:00
Ika f6a95dd2e0 chore(deps): replace parse-srcset with the gh commit one
to avoid potential changes
2018-11-04 23:19:41 +08:00
Ika 5e8a4a115a
feat: support HTML/Vue/Angular (#5259) 2018-11-04 23:03:07 +08:00
Sibiraj 2402a2a07b build: update editorconfig to resolve a deprecated warning (#5307)
This resolves a deprecated warning when installing prettier.

[image](https://user-images.githubusercontent.com/20282546/47603753-0995a700-da0e-11e8-9c89-61e0ff3d13c9.png)
2018-10-28 15:01:53 +08:00
Jordan Brown 5d47e02f64 Update flow parser to 0.84.0 (#5303) 2018-10-26 22:14:47 +08:00
Ika dd4687e7ef
feat(html): whitespace-sensitive formatting (#5168)
- whitespace-sensitive formatting 
  - respect css `display: block`/`white-space: pre` (data from [`html-styles`](https://github.com/marionebl/html-styles))
  - support magic comment (`<!-- display: block -->`)
  - add an option to specify whitespace sensitivity (`--html-whitespace-sensitivity <css|strict|ignore>`)
    - magic comments take precedence
    - (default) `css`: respect default css style (safe in the most cases)
    - `strict`: every node is considered whitespace sensitive (the safest)
    - `ignore`: every node is considered whitespace insensitive (dangerous, the original behavior)
  - inline inline-tags 
- support ie conditional comment (`<!--[if IE]><![endif]-->`)
- indent the script/style content
- no inconsistent output for 2+ attributes
- force break tag if there're multiline attributes
2018-10-13 13:55:38 +08:00
Petter 1244729ad7 Infer via shebang (#5149)
If no file type can be inferred, this attempts to read the first line of a file and extract a shebang, which can be checked against a known list.
2018-10-05 08:47:23 +08:00
Brian Ng 5315e6fe7a
Bump babel-related deps (#5180) 2018-10-02 20:44:54 -05:00
Ika 07abf0588e
fix(html): non-HTML attributes are considered case-sensitive (#5135) 2018-09-27 20:18:00 +08:00
James Henry 81cf08118e
Drop-in replacement: typescript-estree for typescript-eslint-parser (#5139) 2018-09-25 15:44:21 -04:00
Ika 13147facc5
feat(html): switch to htmlparser2 (#5127)
- switch to [`htmlparser2`](https://github.com/fb55/htmlparser2)
  - no need to fork
  - won't generate pseudo nodes ([`parse5` will](https://github.com/prettier/prettier/issues/5098#issuecomment-423055181))
  - should be [faster](https://github.com/fb55/htmlparser2#performance)
- support custom self-closing tags
- support HTML entities
- remove extra trailing newline for `<template>`
- distinguish empty/empty-string attributes (`<tag x>`/`<tag x="">`)
- rename `--parser parse5` with `--parser html`
- enable `html` since 1.15, which means it's enabled by default if you install the dev version from GitHub after this PR merged.
2018-09-22 21:53:38 +08:00
Ika 8e88f52225 chore: bump Prettier dependency to 1.14.3 2018-09-19 21:02:43 +08:00
Evilebot Tnawi 8b0bdf52be [WIP] feat: html support (#4753)
* feat: html support

* fix: support empty lines between children

* refactor: isScriptTagNode util

* refactor: rename `glimmer` and `handlebars` tests

* fix don't add newline after `directive` node

* fix: support `pre` tag

* fix: don't trim comments content

* fix: `script` and `style` tags output

* feat: indent `head` and `body` inside `html`

* fix: better handle quotes around attribute value

* feat: better handle embed

* tests: svg into html

* fix: better handle boolean and empty attributes

* chore(deps): update `parse5` to latest version

* fix: better handle empty attribute

* tests: fix

* fix: extra newline in multiline node

* fix: print `pre` and `textarea` in right way

* tests: xhtml doctype

* fix: use `>` instead `/>`

* tests: case

* refactor: remove `toLowerCase()`

* feat: support `prettier-ignore`

* tests: empty `script` and `style` tags

* fix: clean

* tests: refactor and more
2018-09-13 07:06:49 -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
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
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 55e620bdc7
chore: extract jest snapshot serializers (#5034) 2018-09-01 12:11:19 +08: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 82a12a58a8
fix(config): better error message for unsupported extension (#4969) 2018-08-11 16:35:18 +08: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 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
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
Ika 308863e061
fix(typescript): no invalid output for ImportType in TypeReference (#4939) 2018-08-07 18:53:11 +08:00