Commit Graph

244 Commits (81cf08118e7a93e69b4f6269fb533129dd1b0db8)

Author SHA1 Message Date
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 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
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
Jorge Gonzalez 7d78ce68ef feat(config): support TOML configuration files (#4877)
* Add initial support for TOML in configuration files

* Missed brace

* Fix snapshots

* refactor: move loadToml to utils

* Use @iarna/toml

* Add tests for loadToml

* Fix test for CI

* Remove jest-extended

* Create snapshot for load-toml

* Add feat to docs

* lint docs

* Use @iarna/toml/parse-string

* Change path string
2018-08-03 06:27:19 -04:00
Ika 42ba638f37
fix(yaml): update parser (#4931)
* test: add tests

* fix(yaml): update parser
2018-08-03 15:10:26 +08:00
Brian Ng 1597578b05
Bump babel-parser (#4910) 2018-08-02 22:19:21 -05:00
Ika b6077e175e
fix(yaml): end comment in nested mapping (#4918)
* test: add tests

* fix(yaml): end comment in nested mapping
2018-08-02 22:38:16 +08:00
Ika 440ab4f60b
refactor: upgrade to cosmiconfig@5 (#4899)
* refactor: upgrade to cosmiconfig@5

* fix: use custom require
2018-07-29 16:57:36 +08:00
Ika 514fcb835a chore: bump Prettier dependency to 1.14.0 2018-07-29 15:44:21 +08:00
Ika 1c33224117
fix(typescript): support jsx spread child (#4885)
* fix(typescript): support jsx spread child

* chore(deps): update to use typescript-eslint-parser@17.0.0
2018-07-26 22:13:32 +08:00
Ika cb7fe00863
fix(yaml): support end comments (#4854) 2018-07-18 09:37:53 +08:00
Ika b1c0c8c8d6
refactor(typescript): remove unnecessary experimental types (#4819)
Ref: eslint/typescript-eslint-parser#429
2018-07-10 10:05:31 +08:00
Jed Fox dc362c212d
Report test summaries to CircleCI (#4704)
* Report test summaries to CircleCI

* Don’t run jest-junit on Node <6

(it uses default function parameters)

* Address @lydell’s comment

* Use @duailibe’s suggestion

* 🔥 `jest-junit` key in production package.json

* Move config to jest.config.js
2018-07-07 12:11:04 -04:00
Ika 2271992446
feat(json): add jsonc to aliases and use it to find parser in markdown embed (#4734) 2018-07-07 20:46:34 +08:00
Simen Bekkhus e25021711d Upgrade to Jest 23 (#4809) 2018-07-04 16:54:39 -03:00
Ika 432c9d7d04
feat(yaml): support proseWrap (#4742)
- support `proseWrap` in `yaml`
- move `proseWrap` to `commonOptions`
- update to `yaml@1.0.0-rc.4` and `yaml-unist-parser@1.0.0-rc.1`
2018-07-04 00:28:47 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Ivan Babak b9fb113b3b feat(benchmark): add options to measure performance (#4776) (#4789)
- `--debug-benchmark` uses `benchmark` module to produce statistically significant time measurements.
- `--debug-repeat` uses a naive loop and measures just the average run time, but useful for profiling to highlight hot functions.
2018-07-01 19:49:16 -07:00
Simen Bekkhus d450882289 chore: dedupe dependencies in lockfile (#4781)
I had this lying in my tree when I looked at maybe upgrading Jest. So why not open up a PR with it 🙂 

This is `yarn-tools fix-duplicates` followed by `yarn`.

https://www.npmjs.com/package/yarn-tools
2018-06-30 20:13:26 +08:00
Ika 50d242d085
feat(typescript): support TSOptionalType and TSRestType (#4757)
Ref: Microsoft/TypeScript#24897
2018-06-30 09:10:56 +08:00
Ika e10c31a333
fix(typescript): update typescript-eslint-parser (#4762) 2018-06-29 19:27:21 +08:00
Lucas Duailibe e765d31f8f Release 1.13.7 2018-06-28 16:26:15 -03:00
Ika 0b659b898d
feat: update linguist languages (#4741)
Context: https://github.com/prettier/prettier/pull/4734#issue-196702272

Languages should be easy to maintain now.
2018-06-28 08:24:02 +08:00
Lucas Duailibe 1baddf27f2 Bump Prettier dependency to 1.13.6 2018-06-25 10:59:37 -03:00
Ika 652628b6c9 chore: update lockfile
reflect changes in #4733
2018-06-23 15:26:50 +08:00
Ika f53b5b8323
fix(options): inferParser for standalone (#4721) 2018-06-22 12:43:44 +08:00
Rubén Norte cbef0105e9 Upgrade flow-parser to 0.75.0 (#4727)
* Upgrade flow-parser to 0.75.0

* Added failing test for optional catch binding and flow-parser@0.74.0
2018-06-21 10:50:54 -07:00
Ika dcf44ffbdc
feat: support YAML (#4563)
* feat: support YAML

* fix: do not indent sequence in mappingValue

* docs: add yaml to index.md

* fix: reduce `SyntaxError: Node#parse consumed no characters`

* chore: remove old-build and new-worker.js

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* fix: no space after `<<`

* fix: add yaml to standalone test

* test: add tests

* fix: next empty line in flow collection

* fix: tabs are not allowed
http://yaml.org/spec/1.2/spec.html#space/indentation/

* fix: update parser

* feat: rewrite the mappingItem logic
* feat: indent sequence in mapping
* feat(doc): add ifBreak#groupId and group#id

* chore: fix node 4

* chore: add tools_yaml.svg

* chore: remove resolved TODO

* refactor: remove unnecessary workaround

* chore(worker): importScriptOnce

* chore(build): rename with babelPlugins

* make it rollup compatible

* feat: support singleQuote

* refactor
2018-06-21 10:29:42 +08:00
Lucas Duailibe 9ec1da1ad1
[internal] Cache build results (#4693) 2018-06-18 15:16:40 -03:00
Lucas Duailibe 78ac229956
Transpile webpack generated bundles (#4689) 2018-06-13 17:23:33 -03:00
Brian Ng 3e0dceda99
flow-parser@0.74.0 (#4649) 2018-06-09 17:03:50 -05:00
Ika 98bfd03d93
feat(typescript): support unknown type (#4625) 2018-06-10 00:12:30 +08:00
Lucas Duailibe 6d42fd12e4 Bump Prettier dependency to 1.13.5 2018-06-08 15:06:04 -03:00
Ika f27f6c525b
fix(typescript): preserve decorator on interface (#4632) 2018-06-05 00:08:24 +08:00
Ika ae6abe4d8c chore: bump own prettier to 1.13.4 2018-06-01 20:02:28 +08:00
Lucas Duailibe 16da7d3a76 Bump own Prettier to 1.13.3 2018-05-30 15:04:20 -03:00
Lucas Duailibe 68f594414e Bump own Prettier to 1.13.2 2018-05-29 09:49:47 -03:00
Lucas Duailibe 9da80415f4 Bump own prettier dependency 2018-05-27 15:22:34 -03:00