Commit Graph

51 Commits (ff7bc1c0088bd3517b78f87b19a5151001cb6147)

Author SHA1 Message Date
Nathan Totten a093bb3f7b Adds LWC Parser to support unquoted interop attributes (#5800)
This pull requests adds a new parser option `lwc`. This is the same as the HTML parser, but it adds support for unquoted HTML attributes per the needs of LWC. See: #5627
2019-02-01 13:58:50 +08:00
Ika 7c4cebeaa5
feat: add babel-flow (#5685) 2018-12-29 21:35:47 +08:00
Ika 284764f030
fix(playground): backward compatibility for --parser babylon (#5690) 2018-12-28 14:56:58 +08:00
Ika 86a5c40bc3
fix(playground): backward compatibility for --parser babylon (#5688) 2018-12-28 14:15:22 +08:00
Wei-Wei Wu 91c20f7fbe Rename "babylon" with "babel" (#5647) 2018-12-27 21:05:19 +08:00
Ika 0534735c2f
fix(vue): tweak semicolon for single expression in event bindings (#5519) 2018-11-29 09:28:35 +08:00
Ika fa40f2ddd3
docs(blog): 1.15 release (#5296) 2018-11-07 09:09:04 +08:00
Ika e022abc9b8
chore(playground): add a temporary workaround for parser-vue (#5347)
Temporary workaround
2018-11-05 22:11:59 +08:00
Ika 5e8a4a115a
feat: support HTML/Vue/Angular (#5259) 2018-11-04 23:03:07 +08: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 79f4251e26
chore: enable html on preview playground (#5105) 2018-09-19 09:19:18 +08:00
Ika 1790211f76
feat: support MDX (#4975)
* feat: support MDX

* refactor: flip condition
2018-08-13 22:23:09 +08:00
Ika 1915cc3c46
chore: enable glimmer parser on preview playground (#4915) 2018-08-01 15:44:37 +08: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 c5bbee67d3
fix(playground): no unnecessary import (#4653) 2018-06-09 00:01:14 +08:00
Lucas Duailibe 0d57f22098 Use new worker on playground 2018-05-27 15:24:50 -03:00
Ika 1062f2a889
feat: support JSON.stringify formatting (#4450)
* test: move tests

* feat: support legacy JSON formatting

* fix: add missing assertion

* test: fix coverage

* fix: same output as JSON.stringify

* refactor: fix linting

* refactor: rename to json-stringify

* refactor: fix linting

* fix: should fix the production build

* docs: remove outdated name

* fix(playgound): add lib/parser-json-stringify.js

* feat(playgound): add example for json-stringify

* fix: no error on singleQuote string

* fix(playground): correctly load json-stringify

* fix: identifier is only allowed in ObjectProperty.key

* refactor: clearer
2018-05-14 09:12:25 +08:00
Ika 92485601eb
refactor: fix linting 2018-05-10 02:27:56 +08:00
Lucas Duailibe edcebb0d54
Fix playground (#4454) 2018-05-09 14:27:25 -03:00
Lucas Duailibe c77f1e5987 [playground] Fix doc debug 2018-05-03 10:12:06 -03:00
Ika 643e2a83d6 feat(typescript): support TaggedTemplateExpression typeParameters (#4353)
* test: add tests

* feat(typescript): support TaggedTemplateExpression typeParameters

* fix(playground): `buffer is not defined` in `--parser typescript`

* chore(deps): update typescript-eslint-parser
2018-04-24 08:45:06 -05:00
Lucas Duailibe 9ca95011c0 refactor panels.js 2018-04-19 16:30:35 -03:00
Lucas Duailibe 1ed3865cb6 lint fixes 2018-04-17 18:09:36 -03:00
Lucas Duailibe f90560e6e9 second format 2018-04-17 13:40:55 -03:00
Lucas Duailibe 871ae13bb6 included doc debug 2018-04-12 11:54:30 -03:00
Lucas Duailibe 7b3fecf976 show ast 2018-04-11 22:28:50 -03:00
Lucas Duailibe 47430d0c19 some huge changes 2018-04-11 18:22:03 -03:00
Ika 23cd5d44f7 fix(playground): no undefined parsers (#4159) 2018-03-16 11:37:08 -03:00
Lucas Azzola 7b2349dcd2
Set os.EOL in worker.js (#3935) 2018-02-09 21:31:48 +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
Ika 5e2e7a2881 feat(playground): add example placeholder (#3657)
* feat(playground): add example placeholder

* Add TypeScript example

* fix: mock process.binding

* fix: add missing comma

* refactor: use legacy function

* fix: mock return `{}`

* Return the error stack when there’s a non-SyntaxError thrown

* Code style

* fix: mock path.resolve

* chore: cache placeholder.js

* fix mock path.resolve attempt 2

* fix: mock path.{parse,join,dirname}

* fix: mock process.cwd

* fix: mock path.parse root
2018-01-07 06:59:14 -05:00
Ika 8a86c0cc9f fix(playground): fix report version (#3614) 2017-12-31 12:12:56 +11:00
Ika 0af436cd47 fix(playground): use `prVersion` (#3613) 2017-12-31 00:54:36 +11:00
Lucas Azzola b0647cb2c9
Fix PR Preview Playground (#3592)
* Fix PR Preview Playground

* Use module.exports for Prettier export

* Keep index for backwards compatibility
2017-12-28 22:37:47 +11:00
Lucas Duailibe 2663fd8c6d Fix flow parser + fix CHANGELOG lint 2017-12-05 22:13:38 -02:00
Lucas Duailibe 36a11b86bc Fix multiparser on playground (#3407)
* Fix multiparser in playground

* Remove unnecessary function call
2017-12-06 09:14:02 +11:00
Lucas Azzola c7c1d2e7a4 Upgrade Prettier to Prettier 1.9 (#3395)
* Upgrade to prettier@1.9.0

* Run eslint --fix

* Run prettylint --fix

* Fix playground with editorconfig script
2017-12-05 08:14:03 -02:00
Lucas Duailibe f514d1e93f Docs build script (#3332)
* Remove artifacts from repo

* Remove docs stuff from build script

* Add new docs build script

* Add 'third-party' shim in playground worker

* Build from src if it's a PR

* Add command to package.json and remove old stuff from travis
2017-11-28 09:27:25 +11:00
Lucas Duailibe c0fa47d2d2
Fix infinite recursion in playground (#3305) 2017-11-22 11:23:28 -02:00
Lucas Azzola b4e7942bc0
Add markdown parser to playground (#3165) 2017-11-07 17:11:31 +11:00
Lucas Azzola 212e5f4a20 Fix website getStream regression (#2967) 2017-10-04 00:03:52 +11:00
Simon Lydell 0313ce6299 Fix the playground for 1.7.1 2017-09-27 20:38:16 +02:00
Simon Lydell c6bac7cfe6 Split Less and SCSS parsing into different parsers (#2844)
* Split Less and SCSS parsing into different parsers

Now, .less files are always parsed with postcss-less, and .scss files
areare always parsed with postcss-scss. This:

- Is less hacky.
- Is meant to avoid issues like #2829.
- Is probably more performant.

`parser: "postcss"` and `--parser postcss` continue to work like before:
First trying postcss-less, and if that fails, postcss-scss, unless a
regex says that we should try in the opposite order. The new values for
the parser option are "postcss-less" and "postcss-scss".

* Remove postcss from package.json since it is not used

* Rename parser-less to less and parser-scss to scss

* Deprecate parser:postcss in favor of parser:css

* Fix CSS tests
2017-09-26 07:08:11 +02:00
Simon Lydell ed67690925 Fix playground for the next release 2017-09-16 15:35:32 +02:00
Simon Lydell 219acfe0f8 Fix playground error 2017-09-14 19:52:37 +02:00
Simon Lydell ecaeec5b59 Add feature to test idempotency in playground 2017-09-13 23:40:51 +02:00
Simon Lydell 8ba2acadbb Make sure that shown playground Prettier version always is in sync 2017-09-12 22:17:06 +02:00
Simon Lydell 951aed47f6 Print playground AST with Prettier to make it easier to read 2017-09-12 22:17:06 +02:00
Lucas Azzola 8a45377760 Load babylon parser for json formatting (#2620) 2017-08-15 21:54:10 +10:00
Joseph Frazier 9290dd8803 Add some standardjs-esque eslint rules (#2401)
I experimented with simplifying the eslint config to just use eslint-config-standard and eslint-config-prettier. There were too many errors to make it a quick change, but I did find a few useful rules we could adopt instead.

---

* lint: Remove useless return statements

http://eslint.org/docs/rules/no-useless-return

* lint: Split declarations into multiple statements

http://eslint.org/docs/rules/one-var

* lint: Remove unneeded ternary operators

http://eslint.org/docs/rules/no-unneeded-ternary

* lint: Require symbol descriptions

http://eslint.org/docs/rules/symbol-description

* lint: Disallow declarations in nested blocks

http://eslint.org/docs/rules/no-inner-declarations

* lint: Disallow yoda conditions

http://eslint.org/docs/rules/yoda

* Revert "lint: Disallow yoda conditions"

See discussion at https://github.com/prettier/prettier/pull/2401#discussion_r125750068

This reverts commit f3b568d5bd48a742460cb0f805d1be38d8f61a40.
2017-07-05 16:54:46 -04:00