Boshen
3efbbb2e1f
feat(ast): add "abstract" type to MethodDefinition and PropertyDefinition ( #2536 )
...
closes #2532
```
pub enum PropertyDefinitionType {
PropertyDefinition,
TSAbstractPropertyDefinition,
}
pub enum MethodDefinitionType {
MethodDefinition,
TSAbstractMethodDefinition,
}
```
2024-02-28 17:33:11 +08:00
Boshen
be6b8b7ce6
[BREAKING CHANGE] Change Atom to Atom<'a> to make it safe ( #2497 )
...
Part of #2295
This PR splits the `Atom` type into `Atom<'a>` and `CompactString`.
All the AST node strings now use `Atom<'a>` instead of `Atom` to signify
it belongs to the arena.
It is now up to the user to select which form of the string to use.
This PR essentially removes the really unsafe code
93742f89e9/crates/oxc_span/src/atom.rs (L98-L107)
which can lead to

2024-02-26 19:34:40 +08:00
Boshen
1634586934
refactor(ast): s/TSTypeOperatorType/TSTypeOperator to align with estree
2024-02-21 22:25:04 +08:00
Boshen
9087f71765
refactor(ast): s/TSThisKeyword/TSThisType to align with estree
2024-02-21 22:25:04 +08:00
Boshen
d08abc638e
refactor(ast): s/NumberLiteral/NumericLiteral to align with estree
2024-02-21 21:41:08 +08:00
Boshen
e6b391a24f
refactor(ast): s/ArrowExpression/ArrowFunctionExpression to align estree
2024-02-21 21:41:08 +08:00
Boshen
35608c8eb1
chore: fix all docs
2024-02-21 18:06:37 +08:00
Boshen
a2c173de57
refactor: remove panic! from examples ( #2454 )
...
relates #2308
2024-02-20 16:18:39 +08:00
Boshen
1cbd7539fb
feat(coverage): add prettier idempotency test ( #2402 )
...
closes #1329
2024-02-12 15:30:16 +08:00
Boshen
c4b169e5d6
refactor(prettier): add call_arguments.rs ( #2393 )
2024-02-11 23:16:07 +08:00
Boshen
7e99e52bbc
refactor(prettier): function parameters ( #2392 )
2024-02-11 23:01:19 +08:00
Boshen
747de8cfd4
refactor(prettier): improve Group API ( #2390 )
2024-02-11 21:53:02 +08:00
Boshen
9ff7986610
feat(prettier): handle binaryish expression in return statement ( #2388 )
2024-02-11 20:01:25 +08:00
Boshen
871a73afdd
fix(prettier): semi colon after class property ( #2387 )
2024-02-11 19:25:38 +08:00
Boshen
15a8857927
refactor(prettier): improve print_statement_sequence ( #2383 )
2024-02-11 00:16:26 +08:00
Boshen
82a6dc17d3
feat(pretter): implement print_binaryish_expressions ( #2382 )
2024-02-10 23:18:56 +08:00
Boshen
4e8fcb5110
refactor(prettier): remove BinaryishLeft ( #2381 )
2024-02-10 23:10:33 +08:00
Boshen
2dfe5210bb
fix(prettier): print strings as raw strings ( #2380 )
2024-02-10 17:52:17 +08:00
Boshen
642484e2cb
feat(prettier): print newlines between array expression elements ( #2379 )
2024-02-10 17:31:09 +08:00
Boshen
f194b1fac8
refactor(prettier): clean up implementation of object key ( #2378 )
2024-02-10 16:49:10 +08:00
Boshen
70c983d4bb
feat(prettier): print rest parameters ( #2370 )
2024-02-09 22:59:28 +08:00
Boshen
9b6c313ebf
fix(prettier): flatten all binary expressions for now ( #2367 )
2024-02-09 21:48:27 +08:00
Boshen
ca77ccc951
refactor(prettier): add a space!() macro ( #2348 )
2024-02-09 12:11:42 +08:00
Boshen
651b0b15d1
refactor(prettier): s/nodes/stack ( #2347 )
2024-02-08 23:22:44 +08:00
Dunqing
e4754873ee
fix(prettier): printing value instead of key in BindingProperty ( #2334 )
...
fix : #2314
2024-02-08 21:49:10 +08:00
magic-akari
577d7ab72f
feat(prettier): Support TSImportEqualsDeclaration ( #2321 )
2024-02-05 20:37:26 +08:00
magic-akari
c6273732f6
feat(prettier): Support TSExportAssignment ( #2320 )
2024-02-05 20:33:03 +08:00
underfin
989ab88bc6
fix(codegen): print Directive original string ( #2157 )
...
> A Use Strict Directive may not contain an EscapeSequence or
LineContinuation.
It is `Use Strict Directive` spec, but the `expression` of `Directive`
isn't original string value, it has error if using it to codegen, so
here using `directive` of `Directive` to codegen and not to escape it.
Here is crashed test cases.
``` js
'use str\
ict';
```
The babel will print the original string, I follow it and avoid using
`print_str` because it will escape string.
I also changed some code using the `expression` of `Directive` to check
`Use Strict Directive` .
2024-01-25 15:24:05 +08:00
Dunqing
766ca63aa0
refactor(ast): rename RestElement to BindingRestElement ( #2116 )
...
close : #2115
2024-01-22 14:28:35 +08:00
Boshen
a9e2158362
Update README
2024-01-19 18:39:07 +08:00
magic-akari
9b77d0e6e6
fix(prettier): Correctly print export declaration ( #2014 )
...
Before this PR:
<img width="912" alt="image"
src="https://github.com/oxc-project/oxc/assets/7829098/78605f25-3320-4bed-8a31-3ffa7604cdc7 ">
https://oxc-project.github.io/oxc/playground/?code=3YCAAICUgICAgICAgICyHorESipoTXBToMuz4zZHvH%2B4MPS3Y6F%2FfvvogA%3D%3D
2024-01-13 21:26:33 +08:00
magic-akari
869643b03b
fix(prettier): Correctly format call expression arguments ( #2018 )
2024-01-13 21:25:26 +08:00
Deivid Almeida
c1cfd1759e
feat(linter): no-irregular-whitespace rule ( #1835 )
...
Parser, trivias and trivias_builder were edited to get all whitespaces.
Now Trivias struct store comments and whitespaces Vec. After that, i
will implement the no-irregular-whitespace rule.
P.S.: There isn't a way to implement this feature without lose a little
bit of performance, comparing with my last PR #1819 to minimax this
trouble instead of store the irregular whitespace as Span it was stored
as u32, i removed a map iterator and removed too a unused function. If
you have a suggestion about it pls give me a feedback.
2023-12-31 12:05:38 +08:00
IWANABETHATGUY
4bbc977971
chore: upgrade rustc toolchain to stable 1.75.0 ( #1853 )
...
ref:
https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html
2023-12-29 12:20:51 +08:00
Cameron
29a4a35fd8
fix(prettier) add missing closing brace for dock debug ( #1786 )
2023-12-23 10:59:13 +08:00
Wenzhe Wang
c49a1f6b32
feat(prettier): add print_binaryish_expressions ( #1664 )
2023-12-13 22:52:53 +08:00
Dunqing
0c19991471
feat(prettier): print CallExpression arguments correctly ( #1631 )
2023-12-10 15:59:13 +08:00
Dunqing
6e5aad2639
feat(prettier): add ConditionalGroup command ( #1635 )
2023-12-07 20:12:45 +08:00
Wenzhe Wang
0dec110790
refactor(prettier): move the format of Function's key to PropertyKey ( #1639 )
2023-12-07 17:30:48 +08:00
Wenzhe Wang
286644714f
feat(prettier): wrap parameters in indent ( #1633 )
2023-12-06 10:20:31 +08:00
Wenzhe Wang
633455aba6
refactor(prettier): add print_method_value ( #1632 )
2023-12-06 10:16:09 +08:00
Wenzhe Wang
2aa5f7db91
feat(prettier): finish should_hug_the_only_function_parameter ( #1626 )
2023-12-05 22:55:12 +08:00
Cameron
b7b3073f3f
feat(prettier) port should_break_after_operator ( #1606 )
2023-12-02 20:40:25 +08:00
Cameron
502d61dc9f
fix(prettier) fix use chain formatting ( #1605 )
2023-12-02 15:44:25 +08:00
Boshen
811b219b27
feat(prettier): add parens to new class {} ( #1604 )
2023-12-01 21:36:01 +08:00
Boshen
bb61f10399
feat(prettier): handle parens for (x % y) % z ( #1603 )
2023-12-01 21:29:56 +08:00
Cameron
b4e90a723a
feat(prettier): implement has_comment, improve blank lines when printing arrays ( #1601 )
2023-12-01 20:52:26 +08:00
Cameron
deac95e274
feat(prettier): print blank lines when printing array concisely ( #1600 )
2023-12-01 20:48:10 +08:00
Boshen
f4f392e19f
feat(prettier): add parens to left of instanceof ( #1602 )
2023-12-01 19:08:45 +08:00
Cameron
66452c95f5
fix(prettier) print computed object property key correctly ( #1599 )
2023-12-01 18:36:38 +08:00