Commit Graph

10 Commits (7920e6fddecaecedc01ee39f48d28286ea3a0712)

Author SHA1 Message Date
Warren Seine 7920e6fdde Add a new `trim` command to trim whitespaces in the current line (#4772) 2018-10-06 20:18:52 +08:00
Christopher Chedeau 9910536b58
[unicode] Fix trailing nbsp (#5165)
I don't know why I added all the unicode whitespaces instead of just space and tabs, but it's not only unecessary but also wrong.

Fixes #5077
2018-09-29 15:22:13 -07:00
Ivan Babak 95cc2c97b5 fix(perf): shortcut getStringWidth for ASCII-only strings (#4776) (#4790) 2018-07-01 19:47:55 -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
Ika 35a42bef24
fix(markdown): better handling for trailing spaces (#4593)
- preserve trailing spaces in html, excluding html comment
- `doc-printer` is now unrelated to `options.parser`
- fix some cases that two trailing spaces are mis-considered as `break`
2018-06-08 00:20:25 +08:00
Lucas Azzola b0cb63a7bb
Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00
David Sheldrick d77f5e9c3a Fix cursor offset tracking (#4397)
* handle cusor position relative to comments correctly

* use more robust method of cursor offset tracking

* add support for cursorOffset with rangeStart/End

* add tests for cursorOffset

* use old JS syntax for node4

* add another cursor offset test case

* remove trailing whitespace in cursor tests

* fix null findNodeAtOffset handling

* remove dead code

* add more test cases

* use indexOf for node4

* revert comments.js

* add more comment tests

* change tests infra

* Fix AST_COMPARE

* move CURSOR to top level of file

* mutate result

* use es6 property shorthand

* simplify diff offset calculation

* put remaining test cases in individual files
2018-05-01 09:42:59 -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
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
Lucas Azzola 4c9d4061da
Prettier Plugin API (#3536)
* Move files around in preparation for refactor

* Update paths in build script

* Extract generic printing logic from the JavaScript printer

* Conform printer API

* Fixup decorator handling

* Fix multiparser

* Create plugin entry for markdown

* Create plugin entry for javascript/typescript

* Create plugin entry for html

* Create plugin entry for graphql

* Create plugin entry for css/less/scss

* Move JSON to JS plugin entry

* Integrate plugins into getSupportInfo()

* Move astFormat to parser definition

* Move util to common

* Implement parser loading

* remark -> mdast

* Rename cli/cli -> cli/index

* Rename builder -> doc package, fix printer resolution

* Fix doc shape assumption in CSS-in-JS logic

* Fix third-party.js prod resolution

* Fixup build-docs script

* Distribute multiparser code

* Remove requirement to forward options

* Flatten closure

* Remove debug directory

* Expose doc

* Add external plugins

* Pass options to loadPlugins

* Export getParsers

* Pin resolve version

* Use getSupportInfo in Markdown embed

* Document plugin API

* Update build-docs

* Add CLI for plugins

* Lint docs

* Fixup build.js

* Add vue language

* Fixup multiparser for vue

* Upgrade rollup and rollup-plugin-commonjs

* Fixup third-party build

* Change AST format in docs
2017-12-26 12:23:50 +11:00