Commit Graph
100 Commits
Author SHA1 Message Date
fisker Cheung c3d08c943e Style: Disallow else if in no-else-return (#10310) 2021-02-15 05:29:58 +02:00
fisker Cheung dca2c55ef6 Move embeddedInHtml to language-html/ (#9739)
* Move `embeddedInHtml` to `language-html/`

* Fix

* Rename to `__embeddedInHtml`
2021-02-13 13:34:31 +08:00
fisker Cheung ea63f245d0 Refactor conditionalExpressionChainContainsJsx (#10282) 2021-02-13 05:24:06 +08:00
fisker Cheung bc30016500 Remove isLineNext (#10304)
* Replace `isLineNext` with `isLineOrHardlineOrSoftline`

* Remove `isLineNext`

* Use `isEmptyStringOrAnyLine`

* Update condition
2021-02-11 23:06:47 +02:00
fisker Cheung 37b5b58ea1 Update parse-json 2021-02-11 16:20:41 +08:00
fisker Cheung cb27432b77 Fix changelog 2021-02-11 16:15:37 +08:00
fisker Cheung 659d9a1f1f Add a link to prettier-doc/no-concat ESLint rule (#10188) 2021-02-11 04:39:19 +02:00
fisker Cheung 36d3a0c784 Remove isEmpty (#10295) 2021-02-11 04:36:10 +02:00
fisker Cheung 2f4140ff18 Test: Skip install for standalone test (#10273) 2021-02-11 00:50:59 +08:00
fisker Cheung a1ba8fb812 Build: Add rollup-plugin-polyfill-node (#10249) 2021-02-08 09:50:43 +08:00
fisker Cheung ba3930d63e Replace concat in src/document/ with array (#10185) 2021-02-08 09:48:25 +08:00
fisker Cheung bf3cabd2bb Refactor: Use fromPairs instead of Array#reduce (#10262)
* Refactor: Use `fromPairs` instead of `Array#reduce`

* Restore unrelated change
2021-02-08 00:55:46 +02:00
fisker Cheung 22a10c5589 CLI: Handle logLevel parse error (#10207) 2021-02-07 09:01:28 +08:00
fisker Cheung 75c6dcd6a1 Test: extract some code to createSnapshot (#10255) 2021-02-07 08:59:30 +08:00
fisker Cheung 2a157bf7cb CLI: Print error message when --find-config-path can't find config file (#10208) 2021-02-07 08:52:32 +08:00
fisker Cheung 93409294e6 CLI: clear printed long filenames (#10217) 2021-02-07 08:51:19 +08:00
fisker Cheung 819cc01bfb Safer check before passing to fill (#10235) 2021-02-05 09:24:44 +08:00
fisker Cheung 6ecb30a5ae Refactor ChainElement related parts (#10245)
* Rename `isCallOrOptionalCallExpression` -> `isCallExpression`

* Replace use of `OptionalCallExpression`

* Fix

* Add `isMemberExpression`

* Check truly in `isCallExpression` and `isMemberExpression`

* Replace `OptionalMemberExpression`

* Remove unneeded check

* Fix type check
2021-02-05 01:04:54 +02:00
fisker Cheung 650c21c311 CI: Fix coverage report (#10224) 2021-02-03 18:17:22 +08:00
fisker CheungandGeorgii Dolzhykov 1fa3b1c341 Playground: Allow hide input and output (#10184)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-02-03 11:01:50 +08:00
fisker Cheing a5118601e5 Fix mark-issue-duplicate.yml 2021-02-03 10:12:49 +08:00
fisker Cheung 1bc457d5de Refactor CLI (#10168) 2021-02-02 09:25:36 +08:00
fisker Cheung f04b2b991c Enable no-implicit-coercion rule (#10186) 2021-02-01 13:14:04 +08:00
fisker Cheing c3a59148cf Ignore .nyc_output dir 2021-01-29 18:01:34 +08:00
fisker Cheung 4536fef4fe Simplify printStartingTag in glimmer printer (#10152) 2021-01-28 00:32:08 +02:00
fisker Cheung bba719283d JS: Simplify clean function (#10154) 2021-01-27 14:36:02 +02:00
fisker Cheung a98292e417 Simplify frontMatter parse (#10136)
* Simplify frontMatter parse

* Rewrite regex to @thorn0's version
2021-01-27 01:11:53 +02:00
fisker e8a5d867cd Use ... instead of .concat() 2021-01-26 09:54:20 +08:00
fisker Cheung 89e5751b46 Use Object.{entries,values} if possible (#10131) 2021-01-26 09:48:31 +08:00
fisker Cheung ce26805e84 Enable unicorn/prefer-spread (#10129) 2021-01-26 09:46:14 +08:00
fisker Cheung 743ef3de9b SCSS: Fix maps with keys that are lists or maps (#10005) 2021-01-26 09:45:25 +08:00
fisker CheungandGeorgii Dolzhykov 6175013ae3 Enable unicorn/no-array-for-each (#10112)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-01-24 19:26:42 +08:00
fisker Cheung dd606d9ce1 Enable unicorn/no-array-push-push (#10111)
* Enable rule

* Apply auto-fix

* Manual fix
2021-01-23 22:37:01 +02:00
fisker Cheung 12bddae20c Switch default branch to main (#10115) 2021-01-23 19:14:13 +02:00
fisker Cheung 01052292ab Update eslint-plugin-unicorn to v27 (#10110) 2021-01-23 12:42:59 +08:00
fisker Cheung 0009e0d276 Enable unicorn/prefer-regexp-test (#10045) 2021-01-12 20:37:05 +08:00
fisker Cheung 7b24335064 Refactor: Use Doc[] instead of concat() (#9993) 2021-01-11 13:46:05 +08:00
fisker Cheung 358ad36a84 Forbid use concat() in concat() (#9998) 2021-01-11 10:19:13 +08:00
fisker CheungandSosuke Suzuki 7ec7a0f21f Fix using concat() on single Doc (#9994)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-01-04 14:40:02 +08:00
fisker Cheung 3efa3d3c58 Simplify printBody (#9926) 2021-01-04 10:18:14 +08:00
fisker Cheung 181a325c1c Enable unicorn/explicit-length-check (#9975) 2021-01-04 10:11:57 +08:00
fisker CheungandGeorgii Dolzhykov 9d9c0e2b6f Add Doc[] as Doc (#9733)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-01-04 10:04:30 +08:00
fisker Cheung 27700e5282 Add test to close issue 9102 (#9982) 2020-12-31 21:24:24 +09:00
fisker Cheung c55f899b32 Test internal eslint rules (#9929) 2020-12-24 19:44:17 +08:00
fisker Cheung be497c3c8f Use printBlock to print ClassBody (#9915) 2020-12-21 17:10:03 +08:00
fisker Cheung f0f18d3090 Enable unicorn/prefer-number-properties (#9935) 2020-12-21 17:09:20 +08:00
fisker Cheung 5d69b2e324 Refactor: Move jsx related function to jsx.js (#9927) 2020-12-18 19:21:53 +08:00
fisker Cheung 85abe0fccd Refactor graphql parser to use tryCombinations (#9928) 2020-12-18 19:20:20 +08:00
fisker Cheung d55d4e90d8 Add JS version isNextLineEmpty (#9925) 2020-12-18 10:14:14 +08:00
fisker Cheung ec5f60725b Send array to FastPath#{each,map} callback (#9901) 2020-12-17 15:52:51 +08:00
fisker Cheung c7e354e38c Add isNonEmptyArray (#9902) 2020-12-17 14:46:59 +08:00
fisker Cheung 0fd2a28cff Enable arrow-body-style rule (#9918) 2020-12-17 14:31:51 +08:00
fisker Cheung ea17be725c Move isLastStatement to print/statement.js (#9916) 2020-12-17 12:10:49 +08:00
fisker Cheung 334609d81e Fix comments.js import style (#9917) 2020-12-17 12:09:55 +08:00
fisker Cheung f09ad46166 Use index instead of .getName() in FastPath#each() (#9914) 2020-12-17 10:39:42 +08:00
fisker Cheung 45407d82b9 Refactor yaml (#9629) 2020-12-17 10:39:02 +08:00
fisker Cheung cf8cba363f DRY Block and Program print (#9899) 2020-12-17 09:28:58 +08:00
fisker Cheung d7c9dd0eaf Refactor(html): use concat directly (#9845) 2020-12-17 08:40:45 +08:00
fisker Cheung 790c8ee9db Replace normalizeParts with safer cleanDoc (#9844) 2020-12-17 08:39:23 +08:00
fisker Cheung 1bde9d8856 Refactor: Remove composeLoc function (#9896) 2020-12-16 08:52:59 +08:00
fisker Cheung 94256cac91 Refactor: Simplify JS parsers (#9897) 2020-12-16 08:48:04 +08:00
fisker Cheung a8e0af0585 Simplify escapeTemplateCharacters (#9848) 2020-12-16 08:45:41 +08:00
fisker Cheung 67613d23b2 Refactor: Extract printBody (#9898) 2020-12-15 16:39:59 +08:00
fisker d064a2c441 Fix yarn.lock 2020-12-15 16:38:14 +08:00
fisker Cheung 2c14620ba6 Refactor: Improve JavaScript parser readability (#9783) 2020-12-15 14:09:44 +08:00
fisker Cheung 2725ebee55 Fix unstable JSX formatting with U+3000 (#9866) 2020-12-15 13:45:16 +08:00
fisker Cheung cc9460950d Fix inconsistent directive print (#9850) 2020-12-15 12:24:13 +08:00
fisker Cheung 89402482ee Consistent Jsx case in variables (#9871) 2020-12-15 12:23:40 +08:00
fisker Cheung 099ba04327 TypeScript: Fix missing comments in MethodDefinition (#9872) 2020-12-15 12:22:56 +08:00
fisker Cheung f49e72e371 Use isBlockComment/isLineComment in canAttachComment (#9849) 2020-12-14 08:47:28 +08:00
fisker Cheung 643f8906e0 doc: improve examples in browser (#9811) 2020-12-12 23:10:59 +02: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 Cheung ee1d1a9512 HTML: Remove use of normalizeParts in "text" print (#9846) 2020-12-11 07:44:03 +08:00
fisker Cheung 2ca1fb705a Update @angular/compiler and angular-estree-parser (#9816) 2020-12-07 11:32:18 +08:00
fisker CheungandGeorgii Dolzhykov 52f0894611 Fix stripTrailingHardline function (#9736)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-12-07 10:07:34 +08:00
fisker Cheung 400e30e47e Remove dead code (#9824) 2020-12-07 09:57:27 +08:00
fisker Cheung 11ac80f64e Build: Fix rollup warning (#9808) 2020-12-02 11:10:53 +08:00
fisker Cheung fdaaf2298a Refactor: Stop mutating AST during getSortedChildNodes (#9797) 2020-11-30 18:10:30 +08:00
fisker Cheung c0fbd75288 Fix empty front matter formatting (#9791) 2020-11-30 18:10:09 +08:00
fisker CheungandGeorgii Dolzhykov f59eacd7f6 JS: Fix multiple-comments-on-same-line format (#9672)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-11-30 13:51:49 +08:00
fisker Cheung 05d20a63a4 Exclude node at rangeStart (#9704) 2020-11-30 12:29:48 +08:00
fisker Cheung 902d524d2f Treat .prettierrc as yaml (#8105) 2020-11-30 12:23:20 +08:00
fisker 9f422f6a37 Fix lint:changelog 2020-11-26 20:20:39 +08:00
fisker Cheung 664d0d33b5 Fix inconsistent language comment detection (#9743) 2020-11-26 19:30:57 +08:00
fisker Cheung 25d53fa9b3 SCSS/LESS: Fix comment inside parens (#9710) 2020-11-26 19:28:00 +08:00
fisker Cheung d8e40cd978 JS: Add hasComment and getComments (#9742) 2020-11-25 22:14:27 +08:00
fisker Cheung 125492818c printDocToString: Don't check existance before replacing newLine (#9775) 2020-11-25 22:03:34 +08:00
fisker Cheung 5f01f34453 Add semi to DeclareExportAllDeclaration (#9767) 2020-11-25 19:26:20 +08:00
fisker Cheung d230dccd9a Rename a variable (#9769) 2020-11-25 08:59:26 +08:00
fisker ce9c3a47a5 Fix yarn.lock 2020-11-24 18:24:45 +08:00
fisker Cheung d02a367e64 Remove JSXText spacial case in comment attaching (#9759) 2020-11-24 17:37:29 +08:00
fisker Cheung 3cd70e3a9a Test: Fix AST_COMPARE test (#9768) 2020-11-24 16:13:23 +08:00
fisker Cheung c033455950 Extract some type annotation to flow.js and typescript.js (#9761) 2020-11-24 14:58:26 +08:00
fisker Cheung 7cb7c4920d Move some "TS*" node to print/typescript.js (#9758) 2020-11-23 19:46:14 +08:00
fisker Cheung df60040e1d Move Declare* node to print/flow.js (#9757) 2020-11-23 19:05:37 +08:00
fisker Cheung 3337fc1509 Refactor ConditionalExpression and TSConditionalType print (#9753) 2020-11-23 18:59:31 +08:00
fisker Cheung 895a177b0d Refactor function related functions (#9755) 2020-11-23 18:13:56 +08:00
fisker Cheung 5b4a4eda32 Extract printProperty (#9756) 2020-11-23 18:02:04 +08:00
fisker Cheung 923b281b07 Refactor class related functions (#9754) 2020-11-23 16:48:04 +08:00
fisker CheungandGeorgii Dolzhykov f254314feb Use meriyah (#9731)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-11-23 13:57:13 +08:00