Commit Graph
100 Commits
Author SHA1 Message Date
fisker Cheung 07ae0134e5 JS: Fix duplicated prettier-ignore comments (#10666) 2021-04-12 03:35:13 +03:00
fisker Cheung 24d39a9068 Throw errors for invalid left-hand side assignment (#10416)
* Throw errors for invalid left-hand side assignment

* Fix tests

* FIx tests

* Add tests from https://github.com/babel/babel/pull/12933
2021-03-30 01:40:42 +03:00
fisker Cheung a49df3fc0b Increase dependabot open-pull-requests-limit (#10626) 2021-03-29 10:45:03 +08:00
fisker Cheung cc5981227a Add parens for yield in pipeline (#10446) 2021-03-26 10:19:00 +02:00
fisker Cheung a17d3fb21f Disallow import without argument and new import(…) (#10584) 2021-03-23 09:48:29 +08:00
fisker CheungandGeorgii Dolzhykov 7cc52da144 Simplified printGenerically (#10557)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-22 16:57:03 +02:00
fisker Cheung 199be1ac2f Simplify JS parser handling Hashbang (#10407) 2021-03-22 10:22:18 +08:00
fisker Cheung 230428f34b Add consistent-negative-index-access rule (#10569) 2021-03-20 14:06:12 +02:00
fisker Cheung 863eb079dc Forbid AstPath.call without name (#10541) 2021-03-15 17:20:27 +08:00
fisker Cheung 521b63bb27 Update no-identifier-n rule (#10540) 2021-03-15 11:04:12 +08:00
fisker Cheung 21c81e007d Test json superset (#10493) 2021-03-14 15:04:35 +02:00
fisker Cheung 3995c2a1a1 Whitelist recovered babel parse errors (#10495) 2021-03-13 22:07:22 +02:00
fisker Cheung 1ce6b8dc3d Fix syntax error on JSON range formatting (#10497) 2021-03-12 00:24:45 +02:00
fisker Cheung ff32d6b823 Playground: Order options (#10501)
* Playground: Order options

* Remove `rangeStart/End` from `ENABLED_OPTIONS`
2021-03-10 22:20:47 +02:00
fisker Cheung d3a0699148 Rename n to node (#10504) 2021-03-10 22:14:08 +02:00
fisker Cheung 02f803ac8d JSON: Only allow +/- number in UnaryExpression (#10434) 2021-03-09 10:58:31 +08:00
fisker Cheung 94775e88ef Build: Fix rollup warning (#10487) 2021-03-08 17:08:47 +02:00
fisker Cheung c7f9b9d1e8 Fix a wrong condition (#10478)
* Add rule

* Fix
2021-03-07 12:19:38 +02:00
fisker Cheung 2f6580bebc Simplify babel parser (#10437) 2021-03-05 19:27:08 +08:00
fisker CheungandGeorgii Dolzhykov 8a1ee9ad1b Support JSON6 (#10456)
* Add test

* Support JSON6

* Test

* Print `null` instead of holes

* More tests

* Update changelog

* Style

* Minor refactor

* Fix AST clean

* Fix `Identifier` clean

* Fix AST compare

* Style

* Reword changelog

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-04 19:37:42 +02:00
fisker Cheung 2f384ab24a JSON: More JSON5 data tests (#10453) 2021-03-02 13:43:48 +08:00
fisker Cheung 2edfec5eda JSON: Better error message (#10452) 2021-03-02 13:42:49 +08:00
fisker Cheung ed9e9ab649 Improve json error code frame (#10433) 2021-03-01 10:04:09 +08:00
fisker Cheung 7aff95cac1 Refactor semicolon check (#10355) 2021-03-01 10:03:28 +08:00
fisker Cheung 9324380c53 JSON: Disallow sparse array (#10443) 2021-03-01 09:53:32 +08:00
fisker Cheung ed64ce0f0e JSON: Allow Infinity and NaN (#10451) 2021-03-01 09:14:20 +08:00
fisker CheungandGeorgii Dolzhykov 383e17665e Refactor decorators print (#10296)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-01 02:58:43 +08:00
fisker Cheung c163d346d4 Extract json parser (#10405) 2021-02-28 11:38:21 +08:00
fisker Cheung 95c8086c2c Add flat-ast-path-call rule (#10354) 2021-02-26 09:26:50 +08:00
fisker Cheung 64a3906571 Enable unicorn/prefer-optional-catch-binding (#9464) 2021-02-25 18:28:55 +08:00
fisker Cheung 5682d2f440 Add printDirective (#10396) 2021-02-24 02:29:50 +08:00
fisker Cheung d544585d87 Make JSON parser stricter (#10346) 2021-02-23 13:33:10 +02:00
fisker Cheung f392c7c526 Simplify JS locEnd (#10389) 2021-02-23 12:43:38 +08:00
fisker Cheung 3fc92980f2 Refactor: Switch second parameter of printComments from function to Doc (#10376) 2021-02-23 12:42:13 +08:00
fisker Cheung a9088a0b74 Refactor(JS): Extract printLiteral (#10392) 2021-02-23 12:41:54 +08:00
fisker Cheung a07de7220c Consistent document import style (#10378) 2021-02-21 22:41:36 +02:00
fisker Cheung 88919167e1 Switch ci-info to npm version (#10356) 2021-02-21 22:13:32 +08:00
fisker Cheung 9c6de24405 Style: Disallow == (#10338) 2021-02-21 02:44:16 +02:00
fisker Cheung 04988c3aa0 Remove OptionalMemberExpression clean (#10347) 2021-02-20 09:07:27 +08:00
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