Commit Graph
48 Commits
Author SHA1 Message Date
fisker Cheung 52c9a20e2c Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/cli/index.js
#	tests/config/install-prettier.js
#	tests/format/yaml/block-literal/jsfmt.spec.js
#	tests/integration/__tests__/file-info.js
#	yarn.lock
2022-02-21 16:12:59 +08:00
fisker Cheung da7eb9aa60 Remove duplicated location info in error message from meriyah parser (#12307) 2022-02-16 08:24:53 +08:00
Sosuke Suzuki 8c49fd0f6f Support destructuring private proposal (#12276)
* Enable `destructuringPrivate` plugiin

* Add tests

* Add changelog

* Add more tests
2022-02-14 11:28:47 +09:00
fisker Cheung be0739ec22 Add type:"module" to package.json (#12272) 2022-02-12 15:39:16 +08:00
fisker Cheung 1b6388e9b1 Fix 2022-02-09 10:08:32 +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 6d02cd9650 Add parens to ClassExpression with decorators (#12260) 2022-02-08 15:06:31 +08:00
dependabot[bot] b1645073b8 Build(deps): Bump @babel/parser from 7.16.12 to 7.17.0 (#12241) 2022-02-07 06:15:31 +00:00
fisker Cheung 717e6d8cb7 Follow up work for flow-parser@0.171.0 (#12252) 2022-02-07 11:24:32 +08:00
Sosuke Suzuki 1f50c8417d Run tests for logical-assignment operators witn flow (#12244) 2022-02-06 21:07:02 +09:00
Lucas Duailibe 69ea417f6b Prevent multiple parenthesis around superclass with typecast (#12226) 2022-02-05 11:56:37 -03:00
Lucas Duailibe e73a7bc47e Preserve comment position before super class (#12222) 2022-02-05 10:50:04 -03:00
fisker Cheung 9691e7bc37 Add acorn parser (#12172) 2022-01-28 15:25:30 +08:00
Lucas Duailibe f4d9816bc1 Keep comments of default cases in the same line of the case (#12177) 2022-01-28 00:11:28 -03:00
dependabot[bot]andfisker Cheung 249096c749 Build(deps): Bump @babel/parser from 7.16.8 to 7.16.12 (#12126)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-01-24 17:29:19 +08:00
Sosuke Suzuki db73cc8e0c Print end-of-line comment for continue/break statements (#12075)
* Add handleBreakAndContinueStatementComments to handleEndOfLineComment

* Add tests

* Add changelog

* Update tests

* Add more tests

* Fix for own line comments

* Fix tests

* Fix tests

* Fix tests

* Add unstable tests
2022-01-19 22:29:37 +09:00
fisker Cheung 0cfb9d95e4 Merge branch 'main' into next 2022-01-08 22:19:54 +08:00
Sosuke Suzuki a50bc4e14a Preserve end-of-line comment for if statement without blocks (#12017)
* Print as dangling comments

* Add tests

* Add changelog

* Use symbol instead of string
2022-01-06 09:31:58 +09:00
fisker CheungandSosuke Suzuki 6bd81c23b6 Migrate format test to ES Module (#11902)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2022-01-04 17:00:25 +08:00
Sosuke Suzuki 66e4597c0e Update acorn (#12039) 2022-01-03 04:22:42 +08:00
Hendrik NijmeijerandHendrik Nijmeijer 846069b6c7 recognize waitForAsync as test-statement in Angular (#11992)
* recognize waitForAsync as test-statement in Angular

* Add changelog_unreleased entry

Co-authored-by: Hendrik Nijmeijer <hendrik@hendriknijmeijer.nl>
2021-12-20 17:04:19 -03:00
fisker Cheung 8a85ba4e18 Update acorn (#11835)
* Update `acorn`

* Fix test, add changelog
2021-11-21 01:44:28 +09:00
Sosuke Suzuki 9e1038c0eb Support TypeScript 4.5 syntax (#11813)
* Update dependencies

* Add tests for type-only module specifiers

* Add tests for ts import assertions

* Add tests for ts private-fields-in-in

* Update changelog

* Update misc tests

* Update SYNTAX_KIND_PROPERTY_DEFINITION

* List typescript from error list
2021-11-16 10:15:08 +09:00
Sosuke Suzuki 8f7c2f77a4 Respect spacing for between expressions and parentheses in embedded CSS (#11800)
* Fix embedded css formatting

* Add changelog
2021-11-12 23:17:29 +09:00
fisker Cheung ffbd04ebe2 Fix typo in filename (#11792) 2021-11-09 15:36:42 +09:00
Sosuke Suzukiandfisker Cheung aab66b846b Add more tests, update changelog (#11779)
* Update changelog

* Fix

* Add more tests

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-11-08 22:52:20 +09:00
Sosuke Suzuki 6a0995040d Ignore strict errors by @babel/parser (#11778)
* Ignore StrictEvalArguments

* Ignore EvalArgumentsBinding

* Igngore StrictFunction

* Updates tests for binding eval

* Updates tests for eval

* Update changelog

* Address review
2021-11-08 15:14:20 +09:00
fisker Cheung 9440b70563 Fix error on deleting variables (#11750)
* Fix error on delete variables [skip ci]

* Add changelog
2021-11-06 22:06:30 +09:00
Sosuke Suzukianddependabot[bot] fb7451a1a2 Support right precedence hack-style pipeline (#11557)
* Build(deps): Bump @babel/parser from 7.15.5 to 7.15.7

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.15.5 to 7.15.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.7/packages/babel-parser)

---
updated-dependencies:
- dependency-name: "@babel/parser"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Build(deps): Bump @babel/parser from 7.15.5 to 7.15.6

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.15.5 to 7.15.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.6/packages/babel-parser)

---
updated-dependencies:
- dependency-name: "@babel/parser"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* tmp

* paren

* tmp

* Return parts simply

* Recursive for hack pipe

* Update tests

* Revert shouldFlatten

* Revert needs-parens

* Fix

* Fix lint problems

* Update error message

* Fix isEnabledHackPipeline logic

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-02 11:34:32 +09:00
Kevin GibbonsandSosuke Suzuki b86d36a28b fix parentheses around sequence expression as body of arrow chain (#11593)
* fix parentheses around sequence expression as body of arrow chain

* add changelog

* lint

* Update changelog_unreleased/javascript/11593.md

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-09-28 05:15:17 +09:00
dependabot[bot]andsosukesuzuki 1a5f430f05 Build(deps): Bump flow-parser from 0.159.0 to 0.160.0 (#11544)
* Build(deps): Bump flow-parser from 0.159.0 to 0.160.0

Bumps [flow-parser](https://github.com/facebook/flow) from 0.159.0 to 0.160.0.
- [Release notes](https://github.com/facebook/flow/releases)
- [Changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
- [Commits](https://github.com/facebook/flow/compare/v0.159.0...v0.160.0)

---
updated-dependencies:
- dependency-name: flow-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add flow to import-meta tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-09-20 20:53:42 +09:00
Sosuke Suzuki 2bbe331f64 Regenerate lockfile (#11458)
* Regenerate yarn.lock

* Fix  tests

* Add yarn.lock to workflow paths
2021-09-07 13:10:54 +09:00
Sosuke Suzuki bef39f2394 Update @babel/parser to 7.15.4 (#11436)
* Install new babel/parser

* Add tests for static blocks with line breaks
2021-09-04 22:02:30 +09:00
dependabot[bot]andSosuke Suzuki 493f393ac7 Build(deps): Bump flow-parser from 0.157.0 to 0.158.0 (#11385)
* Build(deps): Bump flow-parser from 0.157.0 to 0.158.0

Bumps [flow-parser](https://github.com/facebook/flow) from 0.157.0 to 0.158.0.
- [Release notes](https://github.com/facebook/flow/releases)
- [Changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
- [Commits](https://github.com/facebook/flow/compare/v0.157.0...v0.158.0)

---
updated-dependencies:
- dependency-name: flow-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add tests for class fields feature (#11394)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-08-24 13:23:31 +09:00
Sosuke Suzuki 53f95f3500 Support hack-style pipeline (#11335)
* Avoid to conflicts to v8intrinsic plugin

* Support hack-style pipeline

* Update tests for hask-style pipeline

* Update tests 2

* Add changelog

* Update misc tests

* Address reviews

* Fix type error

* Copy plugin array

* Add tests

* Address review

* Add error tests
2021-08-15 01:16:13 +09:00
Sosuke Suzuki b6fd414918 Count correctly regex literals in method chain arguments (#11299)
* Use getStringWidth instead of String length

* Add changelog

* Fix changelog
2021-08-02 14:15:07 +09:00
Sosuke Suzuki 1ecae48ae8 Support parenthesized tagged template literals for styled components (#11246)
* Support parenthesized styled.property

* Add changelog

* Fix changelog
2021-07-25 18:16:25 +09:00
fisker Cheung 10053999d7 Update meriyah to v4.2.0 (#11194) 2021-07-12 14:45:33 +08:00
09222ed6e8 Build(deps): Bump espree from 7.3.1 to 8.0.0 (#11162)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-07-07 18:53:09 +08:00
dependabot[bot] 4672b21177 Build(deps): Bump @babel/parser from 7.14.4 to 7.14.5 (#11065) 2021-06-13 17:08:22 +00:00
Jed Fox 261bb0314f Fix repositioning the cursor at the end of a range format (#10938)
* Adjust the upper bound on cursorOffset when range formatting

* fix implementation

* Add changelog entry

* Update changelog entry to use PR number
2021-05-24 02:49:49 +09:00
fisker Cheung 4d37ac46a3 Add __babel_estree parser (#10910) 2021-05-19 09:22:52 +08:00
fisker Cheung 877e64c046 Fix missing parentheses on async inside for..of (#10781) 2021-05-06 16:53:48 +03:00
Sosuke Suzuki edc7a30f26 Support async do expressions proposal (#10813)
* Support async-do-expression proposal

* Add more tests

* Add changelog
2021-05-05 22:32:26 +03:00
dependabot[bot]andsosukesuzuki e29457c952 Build(deps): Bump @babel/parser from 7.14.0 to 7.14.1 (#10819)
* Build(deps): Bump @babel/parser from 7.14.0 to 7.14.1

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.14.0 to 7.14.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.1/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Update tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-05-05 20:48:00 +03:00
Sosuke Suzuki 63c744823b Update babel parser (#10802)
* Update

* Use error codes instead of error messages

* Update js tests

* Update ts tests

* Add comments

* Remove plugins enabled by default

* update misc error tests

* Remove moduleStringNmaes

* use allowedMessagesCode directly

* Remove some misc tests

* Update snapshots for integration tests

* Add Redeclaration to cspell.json
2021-05-03 12:12:25 +09:00
Sosuke Suzuki 6b204193c0 Improve formatting for Module Blocks Proposal (#10758)
* Improve

* Add tests

* Fix tests

* Detect specified option object expression
2021-04-27 12:11:53 +09:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00