Commit graph

1821 commits

Author SHA1 Message Date
Boshen
526db66984
ci: make tests less verbose, printing takes time too 2023-11-16 18:33:11 +08:00
Shannon Rothe
735beb7fab
feat(playground): add prettier formatting + IR (#1349)
- [x] add Prettier format button which takes source text and updates
view with formatted source text
- [ ] add button to show Prettier IR
2023-11-16 09:33:37 +00:00
Boshen
c1c2a01135
ci: no need to build tests on PR branches (#1348) 2023-11-16 17:32:10 +08:00
Boshen
aee733d250
feat(prettier): add print_return_or_throw_argument (#1347) 2023-11-16 17:16:30 +08:00
Boshen
66aae99c63
feat(prettier): add print_function and print_function_parameters (#1346) 2023-11-16 17:01:19 +08:00
Boshen
147b4bc530
feat(prettier): attempt to print leading comments (#1345) 2023-11-16 16:19:40 +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
Boshen
9780621925
chore: run fmt 2023-11-16 13:36:42 +08:00
Boshen
73d6d40778
rust: do not compile libs and bins that do not have tests (#1342) 2023-11-16 13:35:24 +08:00
Boshen
767744afc1
ci: remove cargo nextest because cargo test is now faster (#1341) 2023-11-16 13:31:51 +08:00
Boshen
e8b6e32b7c
ci: disable prettier tests 2023-11-16 12:41:29 +08:00
Boshen
187299bd8f
feat(prettier): add print_call_expression for CallExpression and NewExpression (#1340) 2023-11-16 11:47:30 +08:00
Boshen
cf3318c609
refactor(prettier): use allocator for IfBreak's Box (#1339) 2023-11-16 11:33:30 +08:00
Dunqing
b443a0798f
fix(prettier): remove unnecessary group and ident in BinaryishExpression (#1337) 2023-11-16 11:16:26 +08:00
Dunqing
8d7c0d73d1
feat(prettier): improve the format of ReturnStatement to support longer width (#1336) 2023-11-16 11:10:27 +08:00
Dunqing
2bed242016
feat(prettier): Doc::IfBreak should a accept single doc and add if_break macro (#1335) 2023-11-16 11:03:53 +08:00
Boshen
039b53f6e7
ci: stop benchmark marking prettier and resolver until they are fixed 2023-11-16 10:57:50 +08:00
Boshen
a5734db437
ci: add timeout to benchmark 2023-11-16 10:54:38 +08:00
Boshen
5cafe24bea
chore: update gitmodules for prettier 2023-11-16 10:49:07 +08:00
Boshen
a2f9c8c6b7
feat(prettier): add more expression formatting logic (#1334) 2023-11-15 16:36:15 +00:00
Boshen
9594f62caf
feat(prettier): add print_block (#1333) 2023-11-15 14:56:20 +00:00
Wenzhe Wang
f04921fa95
feat(prettier): format WithStatement (#1332) 2023-11-15 14:49:52 +00:00
Boshen
45d5cf7e0a
chore(prettier): move format.rs to its own directory (#1331) 2023-11-15 13:08:29 +00:00
Boshen
ad49551a3d
ci: add prettier label 2023-11-15 17:44:20 +08:00
Boshen
33a14902d3
perf(prettier): preallocate the output buffer (#1328) 2023-11-15 14:24:47 +08:00
Iván Ovejero
5ade8950e6
feat(linter): Add rule eslint(no_regex_spaces) (#1129) 2023-11-15 14:04:48 +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
Cameron
9c170b89ff
refactor(prettier) Remove flat_contents from IfBreak (#1324) 2023-11-15 10:13:30 +08:00
Hao Cheng
71b3f48af1
feat(linter): eslint-plugin-unicorn/number-literal-case (#1271)
This PR implements the
[eslint-plugin-unicorn/number-literal-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md)
rule.

Tests taken from
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/number-literal-case.mjs.
(Test cases that rely on a Vue parser are removed.)

Related issue: #684
2023-11-15 10:07:19 +08:00
Cameron
01a3a77ead
fix(prettier) indent block stmts correctly (#1323) 2023-11-15 09:59:11 +08:00
Cameron
ebcd707e8b
feat(prettier) Get indentation working (#1322) 2023-11-15 09:58:35 +08:00
Boshen
be043c37e9
refactor(ast): VariableDeclarationKind::to_string -> as_str (#1321) 2023-11-14 15:28:13 +00:00
Boshen
d2b73122c5
refactor(prettier): add a static string ss construction macro (#1320) 2023-11-14 15:20:50 +00: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
Dunqing
ca7e0ab208
fix(prettier): calculate overflow for ObjectPattern (#1317) 2023-11-14 22:58:09 +08:00
Boshen
5773af9536
feat(prettier): complete PrettireOptions (#1319) 2023-11-14 14:57:19 +00:00
Boshen
3edad44d1d
chore(README): add codspeed badges 2023-11-14 21:26:43 +08:00
Dunqing
dee24c7092
feat(prettier): implement format function for PropertyKey (#1311) 2023-11-14 21:22:30 +08:00
Dunqing
fae2813683
feat(prettier): implement format function for BindingProperty (#1310) 2023-11-14 21:16:31 +08:00
Dunqing
211275fd7f
feat(prettier): implement format function for ObjectPattern (#1309)
feat(prettier): implement format function for ObjectPattern

feat: replace space with Line
2023-11-14 21:09:26 +08:00
Dunqing
f597a43d8a
feat(prettier): implement format function for StringLiteral (#1308) 2023-11-14 21:03:26 +08:00
Dunqing
e26e8dd6f8
feat(prettier): implement format function for CallExpression (#1307) 2023-11-14 20:55:26 +08:00
Dunqing
e0af69a884
feat(prettier): implement format function for BindingPattern (#1306)
feat(prettier): implement format function for BindingPattern

feat: full match
2023-11-14 20:48:34 +08:00
Dunqing
071efded7c
feat(prettier): implement format function for VariableDeclarator (#1305) 2023-11-14 20:40:29 +08:00
Cameron
6a062a882f
fix(prettier) Fix subtract with overflow (#1314) 2023-11-14 20:35:33 +08:00
Boshen
5f316626f6
feat(prettier): add the basics of comment printing (#1313) 2023-11-14 12:32:03 +00:00
Dunqing
4967ca2cdb
feat(prettier): implement format function for VariableDeclaration (#1304) 2023-11-14 20:30:27 +08:00
magic-akari
ac6f5884a5
feat(prettier): implement format for MemberExpression (#1312) 2023-11-14 20:23:50 +08:00