Commit Graph
82 Commits
Author SHA1 Message Date
fisker CheungandGeorgii Dolzhykov 0b9cb96f58 Remove support for custom parser api (#13250)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2022-08-08 01:09:10 +08:00
fisker Cheung 83400d19b4 Change default value of trailingComma to "all" (#11479) 2022-08-01 11:05:17 +08:00
fisker Cheung f0b63f3dff Merge branch 'main' into next
# Conflicts:
#	CONTRIBUTING.md
#	cspell.json
#	docs/options.md
#	package.json
#	scripts/build/bundler.mjs
#	src/language-css/loc.js
#	src/language-css/parser-postcss.js
#	src/language-css/utils/index.js
#	tests/format/js/arrows-bind/jsfmt.spec.js
#	tests/format/js/async-do-expressions/jsfmt.spec.js
#	tests/format/js/bind-expressions/jsfmt.spec.js
#	tests/format/js/classes/top-level-super/jsfmt.spec.js
#	tests/format/js/comments-pipeline-own-line/jsfmt.spec.js
#	tests/format/js/decorator-comments/jsfmt.spec.js
#	tests/format/js/decorators-export/jsfmt.spec.js
#	tests/format/js/decorators/jsfmt.spec.js
#	tests/format/js/do/jsfmt.spec.js
#	tests/format/js/export-default/escaped/jsfmt.spec.js
#	tests/format/js/export-extension/jsfmt.spec.js
#	tests/format/js/export-star/jsfmt.spec.js
#	tests/format/js/exports/jsfmt.spec.js
#	tests/format/js/invalid-code/jsfmt.spec.js
#	tests/format/js/logical-assignment/jsfmt.spec.js
#	tests/format/js/multiparser-invalid/jsfmt.spec.js
#	tests/format/js/no-semi-babylon-extensions/jsfmt.spec.js
#	tests/format/js/object-property-comment/jsfmt.spec.js
#	tests/format/js/partial-application/jsfmt.spec.js
#	tests/format/js/pipeline-operator/jsfmt.spec.js
#	tests/format/js/private-in/jsfmt.spec.js
#	tests/format/js/record/jsfmt.spec.js
#	tests/format/js/reserved-word/jsfmt.spec.js
#	tests/format/js/strings/jsfmt.spec.js
#	tests/format/js/throw_expressions/jsfmt.spec.js
#	tests/format/js/trailing-whitespace/jsfmt.spec.js
#	tests/format/js/v8_intrinsic/jsfmt.spec.js
#	tests/format/misc/errors/js/literal/jsfmt.spec.js
#	tests/format/misc/errors/js/object/jsfmt.spec.js
#	tests/format/misc/errors/js/variable-declarator/jsfmt.spec.js
#	tests/integration/__tests__/bundle.js
#	tsconfig.json
#	yarn.lock
2022-02-09 09:22:32 +08:00
fisker Cheung 9691e7bc37 Add acorn parser (#12172) 2022-01-28 15:25:30 +08:00
Joel Bradshawandfisker Cheung 38b5b98393 Clarify documentation around proseWrap (#12134)
* Clarify documentation around proseWrap

These docs were a bit misleading, describing never as "opt-out" when it in fact can result in massive changes in an existing wrapped file is confusing, and referring to the default behavior as "wrapping as-is" is confusing, because Prettier isn't actually doing any wrapping - it's just leaving it as-is. Hopefully this is clearer.

* Update stable version docs

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-01-26 00:33:05 +09:00
fisker Cheung 011672669e Merge branch 'main' into next
# Conflicts:
#	package.json
#	yarn.lock
2021-12-07 15:15:42 +08:00
Jere Kankaanrantaandfisker Cheung 82e6937d50 Added changelog and updated the "first available in" version for singleAttributePerLine (#11934)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-12-07 14:13:26 +08:00
Jere Kankaanranta 0e42acb49b feat: added singleAttributePerLine option (#5501) (#6644) 2021-12-02 11:46:11 +03:00
fisker Cheung 0d6d47b30a Merge branch 'main' into next
# Conflicts:
#	package.json
#	yarn.lock
2021-12-01 16:35:15 +08:00
Chris Midgley 2160e11061 docs: add docs for editorconfig to configuration and options (#11883) 2021-11-30 16:24:07 -03:00
fisker Cheung beba6fa88c Merge branch 'next' of github.com:prettier/prettier into next
# Conflicts:
#	package.json
#	yarn.lock
2021-09-08 12:54:17 +08:00
4992d97203 Deprecate jsxBracketSameLine option in favour of multi-language bracketSameLine option (#11006)
* deprecate jsxBracketSameLine in favour of multi-language angleBracketSameLine option

* update docs and snapshots

* update tests to to make them more reviewable

* Rewrite angular tests

* Rewrite html tests

* Rewrite vue tests

* Restore unnecessary changes in jsx

* Fix file location

* Test both `true` and `false`

* Revert changes in markdown

* Run tests on all js parsers

* Improve html test

* fix changelog comment

* move bracketSameLine to common options

* mark jsxBracketSameLine as deprecated

* Update changelog_unreleased/html/11006.md

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* Update 11006.md

* fix tests by removing `jsxBracketSameLine` `default` property

* fix style

* Revert docs under website dir

* Add tests for deprecated options

* Fix lint problems

Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-08-31 11:47:50 +09:00
fisker Cheung 85fc1fa017 Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/language-css/printer-postcss.js
#	yarn.lock
2021-03-29 19:47:56 +08:00
Georgii Dolzhykov 33ab1fccc8 Clarify docs about pragma (#10500) 2021-03-10 03:40:15 +02:00
fisker Cheung d3c58df606 Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/language-css/utils.js
#	yarn.lock
2021-03-08 17:38:10 +08:00
Georgii Dolzhykov aef9277ada Print trailing comma for TS type parameters but not type arguments (#10353) 2021-02-20 12:47:56 +02:00
Georgii Dolzhykov 3a73f48a0e Don't use smart quotes for JSON5 with --quote-props=preserve (#10323) 2021-02-15 19:13:33 +02:00
Cyrille David 5aa057b40b Handlebars: Default --html-whitespace-sensitivity to strict (#10201)
* Handlebars: Default --html-whitespace-sensitivity to strict

* Record tests other than handlebars

* Trim trailing newlines

* Record tests

* Fix rebase

* Record all tests not only hbs

* Fix the idempotency issue

Adjust dedent for the last child node

* Fix the annoying trailing whitespace

* Trim isolated leading newline
2021-02-11 15:43:07 +02:00
Georgii Dolzhykov 343d372845 Document that Prettier never unquotes numeric properties in TS and Flow (#10126)
* Document that Prettier never unquotes numeric properties in TS and Flow

* Add Angular

* Mention Vue
2021-01-26 20:17:30 +02:00
sosukesuzuki 8436923960 Merge branch 'master' into next 2021-01-23 13:15:50 +09:00
Cyrille DavidandGeorgii Dolzhykov 949c36190f Document --htmlWhitespaceSensitivity option for Handlebars (#10079)
* Document htmlWhitespaceSensitivity for Handlebars

* Update options.md

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-01-19 16:49:19 +02:00
fisker fdfb6ff312 Merge branch 'master' into next
# Conflicts:
#	docs/options.md
#	package.json
#	scripts/build/bundler.js
#	src/language-css/printer-postcss.js
#	yarn.lock
2021-01-11 14:26:20 +08:00
fisker CheungandSosuke Suzuki 6df49ad078 Fix link to babel website (#9856)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2020-12-12 23:10:01 +02:00
fisker 114fe2e6cc Fix typo 2020-11-20 13:34:43 +08:00
fisker 81303dab8c Docs: Add missing meriyah parser 2020-11-20 13:24:02 +08:00
fisker Cheung 8616182e95 Revert #9500 (#9584) 2020-11-09 16:47:12 +08:00
Sosuke Suzukiandfisker f7554c62a2 Revert breaking changes related to adding pure css parser for minor releasing (#9500)
* revert without tests

* Downgrade postcss-scss and postcss-less

* Fix tests

* Revert "Make `isSCSS*` function stricter (#9093)"

This reverts commit 01f986bea9.

* Revert "Remove `css` parser from `isLessParser` check (#9092)"

This reverts commit c0bca1805d.

* Revert "Add pure css parser (#7933)"

This reverts commit 589ebf670b.

* Disable `parser-postcss.js` minify

* Try to fix build script

* Update fs.mjs

* Update fs.mjs

* Style

Co-authored-by: fisker <lionkay@gmail.com>
2020-10-31 22:22:35 +09:00
fisker CheungandChris Brody 73e3976c34 Add espree parser (#9000)
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
2020-10-13 09:14:02 +08:00
fisker Cheung 589ebf670b Add pure css parser (#7933) 2020-08-28 13:07:49 +08:00
Ted Mokeandfisker Cheung 7348a9de14 Docs: Fix links (#8850)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2020-07-28 20:19:10 +08:00
554b15473d Document recommended setup and improve docs overall (#8510)
Co-authored-by: Jed Fox <git@twopointzero.us>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-06-28 09:47:29 +08:00
fisker Cheung f2c1d70918 JS: pragma support files with shebang (#8376) 2020-05-23 19:28:05 +08:00
Georgii Dolzhykov a081bf812c Close simple docs related issues (#8289)
* close #7805

* close #5571

* close #5121

* partially address #8094
2020-05-12 16:00:28 +03:00
Kevin Gibbons 22d149b9f6 Add --embedded-language-formatting={auto,off} option (#7875) 2020-04-11 20:22:44 +03:00
Georgii Dolzhykov f859cafb84 partial revert of #7937 2020-04-06 15:51:21 +03:00
fisker Cheung 096c28f080 Fix docs code style (#7937) 2020-04-03 18:44:03 +08:00
Brad Adams 70da4fa630 docs: fix broken links (#7919) 2020-04-01 03:25:17 +03:00
Georgii Dolzhykov b4a5225770 docs: autocrlf option of Travis CI 2020-03-24 04:24:10 +02:00
JounQinandGeorgii Dolzhykov c1937cb1b8 feat: add new parser babel-ts to parse TypeScript syntaxes via Babel (#6400)
* feat: add new parser `babel-ts` to parse TypeScript syntaxes via Babel

* docs: document parser babel-ts

* chore: enable babel-ts in markdown and worker.js

* verify all TS tests against babel-ts except disabled by disableBabelTS

* support for TSDeclareMethod; fix abstract properties and methods

* fix embedded angular templates and styles

* fix TSImportType

* simplify babel options combinations

* fix method decorators

* fix ranges

* work around loc inconsistencies for SequenceExpression

* don't print trailing comma in type parameters (unsupported in TS < 3.3)

* preserve quotes for class properties

* align printing of single-parameter functions

* fix comments in degenerate single-element unions and intersections

* fix comments for methods

* fix comments for mapped types

* edit docs, change 'since' to 2.0.0

* add changelog

* fix code sample on playground

* update snapshots after rebase

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-29 14:11:16 +02:00
Alexander Kachkaev e00ce8c2c8 Change arrowParens to always by default for 2.0 (#7430) 2020-01-29 13:31:25 +02:00
Alexander Kachkaev 1b3a5d3572 Change endOfLine to lf by default for 2.0 (#7435)
* Towards changing default value for endOfLine

* Update tests and snapshots

* Add placeholder for changelog_unreleased

* Add CHANGELOG

* Undo adding snapshot tests for auto as it does not play well on Windows in CI

* Tweak changelog

* Update jest snapshot
2020-01-28 23:35:47 +02:00
Alexander Kachkaev 210db4700c Document changes in 6963 (#7441)
* Document 6963

* Minor tweaks

* Minor edit

* Add a note on the changed default value in options.md to keep things in sync
2020-01-28 19:09:06 +02:00
fisker Cheung 791996df7b Set trailingComma default value to es5 (#6963)
* Set `trailingComma` default value to `es5`

* Update `options` documentation

* Update tests

* style

* fix js code style

* change options order

* update tests_integration snap

* disable es5 for __ng_interpolation

* fix angular tests

* fix scss test

* fix `css_trailing_comma` snap

* fix css_scss snapshot
2019-11-18 11:39:12 +01:00
kamilic 7d0175ca90 feat: implement --vue-indent-script-and-style mentioned at pr-#… (#6157)
* feat: implement --vue-indent-script-and-style mentioned at pr-#6077

* docs: --vue-indent-script-and-style

* update new test case

* feat: playground for --vue-indent-script-and-style

* chores: Revert package.json version

* Remove noisy snapshots
2019-08-01 11:06:12 +02:00
Lucas Azzola f526c47b1e Add an option to modify when Prettier quotes object properties (#5934)
* Implement quote-props=preserve

* Implement quote-props=consistent

* Add tests

* Enable quoteProps in playground

* Add documentation

* Cache objectHasStringProp calculations

* Fixup changelog
2019-03-06 20:33:08 +11:00
Alon Bukai bf389fb48e fix: grammar if it get -> if it goes (#5835)
Another possible option is `if it gets`

<!-- Please provide a brief summary of your changes: -->

<!-- Please ensure you’ve done all of these things (if applicable). -->
<!-- You can replace the `[ ]` with `[x]` to mark each task as done. -->

- [ ] I’ve added tests to confirm my change works.
- [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the `docs/` directory)
- [ ] (If not an internal change) I’ve added my changes to the `CHANGELOG.unreleased.md` file following the template.
- [x] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md).

**✨[Try the playground for this PR](https://prettier.io/playground-redirect)✨**
2019-02-06 21:31:47 +11:00
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
James Henry 1143619600 chore: update typescript-estree to new package name (#5799) 2019-01-28 19:46:51 -05:00
Jimmy Gaussen a8d423b18c docs: remove redundant "./" from relative links (#5741)
Fixes #5740

fixed with `sed -i "s#(\./#(#" docs/*.md website/versioned_docs/version-stable/*.md`
2019-01-10 12:06:41 -02:00
Ika 7c4cebeaa5 feat: add babel-flow (#5685) 2018-12-29 21:35:47 +08:00