Commit graph

195 commits

Author SHA1 Message Date
Boshen
cc382835ef
feat(prettier): trailing comment (wip) (#1538) 2023-11-27 14:08:39 +08:00
Dunqing
85e8c8bad5
fix(prettier): incorrect order of print in AssignmentTargetPropertyProperty (#1545) 2023-11-27 12:18:32 +08:00
Cameron
d5b636b197
feat(prettier) Improve assignment compatibility (#1547) 2023-11-27 10:01:01 +08:00
Boshen
13cac62402
feat(prettier): print leading comments for all ast nodes (#1537) 2023-11-25 00:35:51 +08:00
Boshen
32b19561a8
chore(prettier_conformance): ignore bind-expressions (#1535) 2023-11-24 20:26:27 +08:00
Dunqing
3ca2f50773
feat(prettier): align ObjectProerty with prettier (#1536) 2023-11-24 20:20:07 +08:00
Dunqing
ac8a5ce574
feat(prettier): support handling of BlockStatement within consequent in SwitchCase (#1533) 2023-11-24 17:15:29 +08:00
Dunqing
ec0ee5cd07
feat(prettier): keep empty lines in SwitchStatement (#1532) 2023-11-24 17:10:27 +08:00
Dunqing
75c75887e3
feat(prettier): trim spaces when printing hardline (#1531) 2023-11-24 17:05:20 +08:00
Boshen
e55fdc6452
feat(prettier): add parens to conditional and arrow expr (#1530) 2023-11-24 15:07:29 +08:00
Boshen
78c6fcd1d0
feat(prettier): improve format of ExportDefaultDeclaration (#1520) 2023-11-23 21:52:56 +08:00
Dunqing
3758e6f6a5
feat(prettier): handle the logic inside the parentheses in BinaryExpression and LogicalExpression (#1516) 2023-11-23 18:32:25 +08:00
Dunqing
490a589ded
feat(prettier): print binarylish correctly in SwitchStatement (#1515) 2023-11-23 18:29:00 +08:00
Dunqing
635008a408
feat(prettier): support print empty switch (#1514) 2023-11-23 16:19:42 +08:00
Boshen
ef59f544b4
feat(prettier): handle binary in in for statement init (#1512) 2023-11-23 12:50:30 +08:00
Dunqing
bec365e1b6
feat(prettier): support propagate breaks (#1511)
regression tests are the expected result
2023-11-23 10:44:41 +08:00
Boshen
2d5e0d5d07
feat(prettier): handle parens for member expression inside new expression (#1505) 2023-11-22 16:22:49 +00:00
Boshen
6410502cc6
refactor(prettier): rename file need_parens -> needs_parens (#1504) 2023-11-23 00:04:00 +08:00
Boshen
93c461a5b9
feat(prettier): format number in member expression (#1499) 2023-11-22 21:52:06 +08:00
Boshen
567c6ed757
feat(prettier): print directives (#1497) 2023-11-22 19:39:25 +08:00
Boshen
cf803d379a
feat(prettier): add parens to ExportDefaultDeclaration (#1494) 2023-11-22 19:34:37 +08:00
Dunqing
aa8656df0f
feat(task/prettier-confromance): escape template literal (#1493) 2023-11-22 15:30:59 +08:00
Dunqing
f06f0f2078
feat(task/prettier-confromance): ignore tests with non-standard syntax (#1492) 2023-11-22 11:01:26 +08:00
Boshen
064353c97e
feat(prettier): turn off preserve_parens and start working on need-parens (#1487) 2023-11-21 16:26:56 +00:00
Dunqing
f1874c7955
feat(prettier): should be newline if break in AssigmentExpression (#1484) 2023-11-21 18:50:26 +08:00
Dunqing
c762a85fcc
feat(prettier): print inner comment in PropertyKey (#1479) 2023-11-21 17:26:36 +08:00
Dunqing
79c2bac6b1
feat(prettier): support longer source in ImportExpression (#1478) 2023-11-21 17:21:23 +08:00
Dunqing
51a78e2223
feat(prettier): support print inner comment in CallExpression (#1475) 2023-11-21 12:28:46 +08:00
Dunqing
d64ed0a953
feat(prettier): support format commonjs and amd call (#1473) 2023-11-21 10:05:39 +08:00
magic-akari
4c213a1c14
fix(prettier): async arrow expression (#1457) 2023-11-20 22:58:37 +08:00
magic-akari
59b8fdfaa5
fix(prettier): class extends clause (#1456) 2023-11-20 21:45:28 +08:00
magic-akari
18d8be0353
fix(prettier): class without name (#1455) 2023-11-20 21:41:14 +08:00
magic-akari
eecf8d3dc6
fix(prettier): print_method (#1453) 2023-11-20 12:41:36 +00:00
Dunqing
719ed744e0
feat(prettier): implement should_break in CallExpression and Object (#1448) 2023-11-20 17:07:32 +08:00
Dunqing
aabed6bee8
feat(prettier): when calculating the remaining width, the docs of the remaining commands should be included (#1441) 2023-11-20 16:59:06 +08:00
Dunqing
ca06126d50
feat(prettier): support format function for ImportNamespaceSpecifier (#1443) 2023-11-20 07:24:15 +00:00
Boshen
6892a298cf
feat(prettier): add spacing before empty bracket in ImportDeclaration (#1447)
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-11-20 15:14:38 +08:00
Boshen
1a576f60a8
refactor(rust): move to workspace lint table (#1444) 2023-11-20 14:38:10 +08:00
Cameron
d02b7470d9
feat(prettier) print ?. when a printing an optional call expression (#1440) 2023-11-20 09:40:28 +08:00
Cameron
a53c5e9bab
feat(prettier) check original state for new lines when formatting properties (#1439) 2023-11-20 09:36:26 +08:00
Boshen
27dc1ed1b2
chore(prettier_conformance): ignore more non-es6 syntax (#1437) 2023-11-19 23:15:24 +08:00
Boshen
0218ae8641
feat(prettier): print leading comments with newlines (#1434) 2023-11-19 22:46:55 +08:00
Boshen
95f1b3beba
chore(prettier_conformance): ignore stage3 and multiparser tests (#1432) 2023-11-19 18:47:39 +08:00
Boshen
cf388ae79e
feat(prettier): format empty try catch (#1430) 2023-11-19 18:01:49 +08:00
Boshen
18fa8e45a4
feat(prettier): format for((let) of .. (#1429) 2023-11-19 17:48:09 +08:00
Wenzhe Wang
3c567d6549
task(prettier): add diff view (#1428) 2023-11-19 17:13:25 +08:00
Boshen
cc8b8719f7
feat(prettier): format for loop and update expression (#1427) 2023-11-19 14:04:47 +08:00
Boshen
902d4d0bab
feat(prettier): format with and if statements (#1425) 2023-11-19 11:47:31 +08:00
Dunqing
b945307ab3
feat(prettier): support format function for ImportDefaultSpecifier (#1424) 2023-11-19 11:10:08 +08:00
Wenzhe Wang
d6b913e46a
feat(prettier): add trailing comma (#1422) 2023-11-19 11:08:25 +08:00
Boshen
1dacb645d0
feat(prettier): start adding parent stack (#1415) 2023-11-18 16:39:24 +00:00
Boshen
d0a70d0626
feat(prettier): print class method and read tab width (#1413) 2023-11-18 22:42:53 +08:00
Dunqing
b0248acb7b
refactor(prettier): refactor binaryish expression formatting (#1412) 2023-11-18 22:03:26 +08:00
Dunqing
f6ecd96e69
feat(prettier): print getter/setter function in PropertyKey (#1411) 2023-11-18 21:59:22 +08:00
Boshen
bc3069ec76
feat(prettier): print empty object properties (#1409) 2023-11-18 16:52:54 +08:00
Boshen
24c2580435
chore(prettier_conformance): remove stage 3 features 2023-11-18 16:13:12 +08:00
Boshen
481af5040d
feat(prettier): format hashbang (#1406) 2023-11-18 16:00:52 +08:00
Boshen
323f2f9789
feat(prettier): format more import and export declarations (#1404) 2023-11-18 15:37:56 +08:00
Dunqing
b251c10b09
feat(prettier): print parameters in ArrowExpression (#1400) 2023-11-18 05:37:55 +00:00
Dunqing
7951849ec1
feat(prettier): support format function for ImportExpression (#1399) 2023-11-18 13:34:14 +08:00
Dunqing
75eb708526
feat(prettier): transform expression to identifier in PropertyKey (#1398) 2023-11-18 11:20:43 +08:00
Boshen
8cb0795796
feat(prettier): format SequenceExpression and ParenthesizedExpression (#1397) 2023-11-18 10:19:12 +08:00
Cameron
39341e4688
feat(prettier) Print function args correctly (#1395) 2023-11-18 09:47:27 +08:00
Cameron
db71974655
feat(prettier) Print labeled statement (#1393) 2023-11-18 09:36:28 +08:00
Boshen
7ed067ec28
feat(prettier): print NumberLiteral (#1389)
feat(prettier): print NumberLiteral

feat(prettier): format `NumberLiteral`
2023-11-18 02:06:09 +08:00
Cameron
b025213795
feat(prettier) port adjust clause (#1388) 2023-11-18 01:58:27 +08:00
Boshen
f8b9679d74
feat(prettier): print module specifiers (#1383) 2023-11-17 22:03:28 +08:00
Boshen
1dcd29a91b
feat(prettier): support endOfLine option (#1377) 2023-11-17 20:50:17 +08:00
Dunqing
7b85843981
feat(task/prettier-conformance): add spacing before block in IfStatement (#1374) 2023-11-17 20:19:26 +08:00
Dunqing
badf6f51cf
feat(task/prettier-conformance): splitting test cases by file (#1373) 2023-11-17 20:14:00 +08:00
Dunqing
a8e4c3333c
feat(prettier): wrap a group in BinaryExpression (#1370) 2023-11-17 19:00:29 +08:00
Dunqing
6ac6d7158f
fix(prettier): incorrect dot operator in MetaProperty (#1369)
fix(prettier): incorrect dot operator in MetaProperty

test: update snap
2023-11-17 17:56:57 +08:00
Boshen
5a6c83b0cc
feat(prettier): print NewExpression correctly (#1368) 2023-11-17 16:38:19 +08:00
Boshen
bfdb6eac86
feat(prettier): print statements with newlines (#1367) 2023-11-17 15:13:51 +08:00
Dunqing
9b94226531
feat(prettier): support single_quote option (#1366) 2023-11-17 14:07:29 +08:00
Dunqing
1116afa7bc
fix(prettier): remove extra empty lines inside the function body (#1365)
I'm not sure that's the right approach. But we can handle it this way for now
2023-11-17 14:03:26 +08:00
Boshen
9754ef0d95
feat(pretter): start formatting ModuleDeclaration and ArrowExpression (#1354) 2023-11-16 21:38:21 +08:00
Dunqing
40be405a57
feat(prettier): support for printing objects with longer properties (#1353) 2023-11-16 20:48:27 +08:00
Dunqing
a099d06866
fix(tasks/prettier-conformance): incorrect snapshot (#1352)
fix(tasks/prettier-conformance): incorrect snapshot

fix: lint
2023-11-16 20:43:32 +08:00
Boshen
bc302f4f8b
feat(prettier): print big int with lowercase (#1351) 2023-11-16 19:04:12 +08:00
Dunqing
95268c9e0d
feat(prettier): implement format function for ObjectExpression (#1344) 2023-11-16 16:01:36 +08:00
Dunqing
638bd1ce23
feat(tasks/prettier-conformance): allow specifying filter as specific files (#1343)
This is useful in directories with a large number of files, so that we only need to focus on the file we are debugging.
2023-11-16 15:56:47 +08:00
Dunqing
b443a0798f
fix(prettier): remove unnecessary group and ident in BinaryishExpression (#1337) 2023-11-16 11:16:26 +08:00
Dunqing
ba0e4d1a6a
feat(tasks/prettier-conformance): parse the specs and pass the correct options to prettier (#1327)
### This PR did the following things.

1. Parse specs
2. Collect `run_spec's` arguments
3. Pass the correct `PrettierOptions` to the `Prettier`
4. Printing snapshots correctly
2023-11-15 13:30:44 +08:00
Cameron
e5a34366af
fix(prettier) Fix printing of array expressions (#1325) 2023-11-15 10:18:32 +08:00
Dunqing
96753c2efd
feat(prettier): add HardLine if the next line of the VariableDeclartion is a empty line (#1318) 2023-11-14 23:04:27 +08:00
Boshen
5f316626f6
feat(prettier): add the basics of comment printing (#1313) 2023-11-14 12:32:03 +00:00
Boshen
e1266c69f9
chore(prettier_conformance): temporary disable code coverage 2023-11-14 15:13:25 +08:00
Shannon Rothe
d5e46ef929
fix(tasks/prettier_conformance): fix incorrect casing in README (#1295) 2023-11-14 13:41:48 +08:00
Dunqing
f13e9aa69d
feat(task/prettier-conformance): incorrect compatibility percentage (#1292) 2023-11-14 12:22:27 +08:00
Dunqing
c15b76b92d
feat(prettier): add HardLine and Semicolon in ExpressionStatement (#1285) 2023-11-14 12:14:45 +08:00
Cameron
561c73d88c
feat(printer) Basic Printer options (#1278) 2023-11-14 09:37:18 +08:00
Dunqing
0297cf7cc7
fix(prettier): remove redundant newline and semicolons from the Program (#1284) 2023-11-14 09:36:37 +08:00
Boshen
5c1637b786
feat(prettier): add some basic formatting functions (#1266) 2023-11-13 13:27:53 +00:00
Boshen
4a6f54cc1a
feat(prettier_conformance): add prettier test runner (#1262) 2023-11-13 20:14:35 +08:00