Commit Graph
135 Commits
Author SHA1 Message Date
fisker Cheung 3fe4666a85 Consistent parser errors (#9406) 2020-10-16 10:39:05 +08: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 47ed40d970 Enable CR test (#9148)
* Enable `CR` test

* Fix tests

* Ignore `standalone.js`
2020-09-17 07:35:33 +08:00
fisker Cheung 8676daed0a Minor tweak (#9014) 2020-08-21 13:06:56 +08:00
fisker Cheung 1d2ff824cc Improve requirePragma on files with BOM (#9003) 2020-08-21 10:30:42 +08:00
fisker Cheung 86ad299768 Improve internal range calculate (#9012) 2020-08-21 09:44:20 +08:00
fisker Cheung d31ebf4619 Test: Improve coverage (#8811) 2020-08-21 09:43:24 +08:00
fisker Cheung 2ff156136f Improve internal cursorOffset calculate (#9013) 2020-08-21 09:09:15 +08:00
Chris Brodyandfisker cdc250c21a typecheck updates & fixes in src/language-js (#8759)
Co-authored-by: fisker <lionkay@gmail.com>
2020-08-21 09:08:14 +08:00
fisker Cheung 97b899b7bc Improve multiparser handle finalNewLine and frontMatter (#8595) 2020-08-16 16:12:20 +08:00
fisker Cheung 6833310f87 Fix wrong range format on files with BOM (#8936) 2020-08-10 22:18:55 +08:00
fisker Cheung a340799a3d CLI: Don't suggest -_ for unknown flags (#8934) 2020-08-10 21:57:54 +08:00
fisker Cheung 25398a943f Minor refactor (#8935) 2020-08-10 21:57:02 +08:00
fisker Cheung 441f2325b5 Do not trim options.originalText (#8783) 2020-07-21 21:26:39 +08:00
fisker Cheung 5004661ef1 Add tokens to js parsers (#8529) 2020-07-21 07:43:35 +08:00
fisker Cheung 9ebe5adb54 Ensure comments for ignored node are printed (#8777) 2020-07-20 09:19:40 +08:00
fisker Cheungandsosukesuzuki c8f9d254b9 Minor refactor (#8752)
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2020-07-17 09:08:03 +08:00
fisker CheungandGeorgii Dolzhykov 07e5b06a1f Fix unstable pair of comments between class methods (#8731)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-07-15 12:16:49 +08:00
fisker Cheung 55d7f74d68 Use locStart/locEnd instead of start/end (#8724)
* Use `locEnd` instead of accessing node.end

* Use `locStart`

* Fix use of node.range
2020-07-14 15:07:16 +03:00
fisker Cheung 350f641fca Fix util import (#8696) 2020-07-05 00:34:35 +08:00
fisker Cheung 231bbc246a Generate fresh yarn.lock (#8702) 2020-07-02 23:12:32 +08:00
fisker Cheung 0c2b918078 ESLint: enable import/order (#8635) 2020-06-26 20:30:21 +08:00
Georgii Dolzhykov 5a0e33cc84 fix(range): improve detection of JS source elements (#8419)
* fix(range): improve detection of JS source elements

* Add changelog entry

* Remove unneeded comment

* Add more types and update snapshots
2020-05-29 07:29:09 +03:00
Georgii Dolzhykov 81d7e06973 Fix range indentation (#8410) 2020-05-27 11:48:32 +03:00
Georgii Dolzhykov 7f2ba08fb0 refactor(range): minor cleanup (#8421) 2020-05-27 11:48:02 +03:00
Georgii Dolzhykov 67cbab7f48 Add plugins' parsers to the parser option (#8390)
* Add plugins' parsers to the `parser` option

* Add changelog entry

* Add plugin name to value description

* Update snapshot
2020-05-25 14:03:20 +03:00
Georgii Dolzhykov d420202df4 fix(js): comments after superclass (#8312)
* Fix comments after superclass

* add changelog

* refactor

* Organize tests

* Use addBlockStatementFirstComment

* Amend unstableTests list

* Avoid identical comments in tests

* Add tests for `implements`

* Handle comments in interfaces

* Remove an always-false condition

* Almost a fix

* Further fixes

* Add DeclareClass

* Add DeclareInterface, mixins

* Fix extends in DeclareClass

* Fix DeclareClass

* Fix mixins

* Refactor: remove unused parameters

* Add marked dangling comments

* Unify printing of interface for TS and Flow

* Fix unstable interfaces

* Remove comment

* Restore the original behavior for interfaces with multiple inheritance

* Refactoring, tests

* Remove unused code

* Include a file accidentally omitted from the merge commit

* Remove unused type import
2020-05-24 21:53:29 +03:00
fisker Cheung 76b4970c2e Update ESLint related dependencies (#8299) 2020-05-14 10:51:11 +08:00
fisker Cheung c768be4dd3 Switch dedent to outdent (#8240) 2020-05-11 09:05:06 +08:00
Masashi Hiranoandfisker Cheung 1528e45ff2 JS: Fix end-of-line comments if followed by trailing whitespace (#8069)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2020-04-25 10:38:06 +08:00
Kevin Gibbons 22d149b9f6 Add --embedded-language-formatting={auto,off} option (#7875) 2020-04-11 20:22:44 +03:00
fisker Cheung 69d121b19e Enable unicorn/prefer-set-has (#7990) 2020-04-09 13:22:28 +08:00
Sidharth Vinod 04e4ef3758 Uniform line endings for multi line strings/comments (#7891) 2020-04-05 13:51:29 +03:00
Georgii Dolzhykov ba500e22f9 Refactor inferParser to extract interpreter only once (#7835) 2020-03-23 03:33:53 +02:00
Georgii Dolzhykov 6835aa8dda fix prettier-ignore in union types (#7798) 2020-03-23 00:51:40 +02:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +02:00
Georgii Dolzhykov 3f1c46373a Expand directories in CLI (2020) (#7660) 2020-03-17 01:34:32 +02:00
Sosuke Suzuki 78fe9cab73 JavaScript: Keep comments position for assignment/variable (#7709) 2020-03-10 11:37:42 +02:00
fisker Cheung 04012b9dc7 Remove --flow-parser/useFlowParser (#7511) 2020-02-24 19:30:12 +02:00
fisker Cheung fc8218b5a6 Remove postcss parser (#7535) 2020-02-24 18:58:16 +02:00
fisker Cheung b3f0102a87 Remove babylon parser (#7533)
* Remove `babylon`

* Add changelog

* Fix website files
2020-02-24 18:19:03 +02:00
Georgii Dolzhykov cf3d9f0b80 api: remove the version parameter of getSupportInfo (#7620)
* api: remove the version parameter of getSupportInfo

* add changelog entry

* remove mapDeprecated

* Update pr-7620.md

* remove the first parameter completely

* Update api.md

* add default value for opts just to be on the safe side
2020-02-23 02:47:17 +02:00
fisker Cheung e2e534df30 Remove normalize-path package (#7465)
* Remove `normalize-path` module

* Try run all tests on `standalone`

* Restore test

* Add `no-parser-tests`

* Fix issue with shim

* DRY

* Rename tests

* Use `endsWith`
2020-02-03 01:33:19 +02:00
fisker Cheung 0370f47cb3 Refactor some Object.assign (#7437) 2020-01-31 09:13:37 +09: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
Panayiotis Lipiridis 0c51368d33 Merge branch 'master' of github.com:prettier/prettier into next
* 'master' of github.com:prettier/prettier:
  Clarify API docs (#7402)
  Fix typo (#7425)
  [docs] Add Tidelift to cspell.json
  website: add Tidelift enterprise language (#7424)
  Use BOM string instead of BOM charCode (#7420)
2020-01-29 13:45:45 +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
fisker Cheung c0517441b2 Enable unicorn/prefer-string-slice (#7251) 2020-01-23 15:15:28 +03:00
fisker Cheung 9d9b4a15e5 Use BOM string instead of BOM charCode (#7420)
* Use BOM string instead of BOM charCode

* Trigger CI
2020-01-23 13:40:05 +02:00
fisker Cheung e5234162eb Fix prefer-object-spread in src/main (#7357) 2020-01-16 15:54:58 +02:00