Commit graph

157 commits

Author SHA1 Message Date
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 

![image](https://github.com/oxc-project/oxc/assets/1430279/8c513c4f-19b0-4b63-b61c-e07c187c95b5)
2024-02-26 19:34:40 +08:00
Boshen
5212f7b51e
fix(parser): fix missing end span from TSTypeAliasDeclaration (#2485)
closes #2483
2024-02-24 16:51:00 +08:00
Boshen
d08abc638e refactor(ast): s/NumberLiteral/NumericLiteral to align with estree 2024-02-21 21:41:08 +08:00
Boshen
83cb78fbb0
feat(coverage): add prettier idempotency test (#2403)
feat(coverage): add prettier idempotency test

closes #1329

feat(prettier_conformance): enable TypeScript
2024-02-12 16:20:09 +08:00
Boshen
70a0076eed
refactor: remove global allocator from non-user facing apps (#2401)
The runtime performance gains does not out weight the compilation speed from
building the custom allocators, which takes about a minute to build on
slower machines.
2024-02-12 14:09:05 +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
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
ef336cb66b
feat(parser): recover from async x [newline] => x (#2375)
```javascript
async x
=> x
```

Babel recovers and displays "No line break is allowed before '=>'
2024-02-10 11:19:08 +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
90a834f87b
chore: update snapshot 2024-02-09 21:08:39 +08:00
Dunqing
e4754873ee
fix(prettier): printing value instead of key in BindingProperty (#2334)
fix: #2314
2024-02-08 21:49:10 +08:00
Dunqing
3268d7d66e
feat(tasks/prettier): add some information for debug no spec calls (#2333) 2024-02-07 16:55:59 +08:00
Boshen
e8dc68c525
chore: update prettier to v3.2.5 (#2332) 2024-02-06 22:55:43 +08:00
Boshen
d2f7ea2923
chore: manually clone git modules instead of using submodules (#2274)
closes #2231

Submodules are a blocker for beginners, we should make it clone on
demand.

It is also a blocker for people who wants to target this repo as a crate
for testing purposes, cargo will do a full clone if you specify
oxc_parser = { git = "this repo" } in Cargo.toml
2024-02-02 11:56:18 +00:00
Boshen
a69b76ab77
chore: update snapshots 2024-01-15 21:13:05 +08:00
Valerii Smirnov
c60c31521e
feat(linter): eslint-plugin-import no-named-as-default-member rule (#1988)
- Docs:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
- Code:
https://github.com/import-js/eslint-plugin-import/blob/main/src/rules/no-named-as-default-member.js
- Tests:
https://github.com/import-js/eslint-plugin-import/blob/main/tests/src/rules/no-named-as-default-member.js
2024-01-15 11:03:04 +00:00
magic-akari
869643b03b
fix(prettier): Correctly format call expression arguments (#2018) 2024-01-13 21:25:26 +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
Wenzhe Wang
286644714f
feat(prettier): wrap parameters in indent (#1633) 2023-12-06 10:20:31 +08:00
Wenzhe Wang
bb4a2c7930
chore: fix typo (#1627) 2023-12-04 21:52:50 +08:00
Wenzhe Wang
cfe207fb53
feat(tasks): ignore some invalid cases and support read parser from source text (#1616) 2023-12-03 21:17:47 +08:00
Wenzhe Wang
9af24842a8
fix(tasks): escape more special characters (#1615)
We also need escape `$` and `\`:
9527e65a38/packages/snapshot/src/port/inlineSnapshot.ts (L78-L94)
2023-12-03 16:56:18 +08:00
Wenzhe Wang
2f90ca1b54
fix(tasks): find the right output to diff (#1596) 2023-12-03 15:29:13 +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
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
Cameron
0134211b6f
fix(prettier) use print_assignment for ObjectProperty (#1598) 2023-12-01 18:32:03 +08:00
Boshen
da87b9b29e
feat(prettier): binaryish expressions with parens (#1597) 2023-12-01 13:52:22 +08:00
Boshen
e3c54b92c9
fix(prettier): object pattern in function parameters (#1595) 2023-11-30 23:49:24 +08:00
Wenzhe Wang
9f38072002
feat(tasks): add visualize_end_of_line (#1593) 2023-11-30 23:42:57 +08:00
Dunqing
39188d00e1
feat(prettier): support arrowParens option (#1592) 2023-11-30 17:41:34 +08:00
Boshen
fd6a3ed918
feat(prettier): format for((async) of and for((let) of (#1586) 2023-11-29 22:55:42 +08:00
Boshen
1bd1c5b51b
feat(prettier): check parens for (let)[a] = 1 (#1585) 2023-11-29 21:57:59 +08:00
Boshen
e6681a8683
feat(prettier_conformance): ignore more stage3 features (#1584) 2023-11-29 19:51:41 +08:00
Boshen
c50fcececa
feat(prettier): wrap return statements with parentheses (#1583) 2023-11-29 19:31:55 +08:00
Boshen
b8ce6266ad
feat(prettier): handle parens for sequence expression (#1582) 2023-11-29 19:15:57 +08:00
Boshen
405d1228a0
feat(prettier): wrap BindingIdentifier (#1581) 2023-11-29 19:08:29 +08:00
Boshen
e6f85a9a62
chore(prettier_conformance): remove stage3 export-default-from (#1580) 2023-11-29 19:03:26 +08:00
Dunqing
63b9d2cf81
feat(prettier/conformance): print options (#1579) 2023-11-29 18:37:38 +08:00
Dunqing
f19032e102
feat(prettier): support quoteProps option in PropertyKey (#1578) 2023-11-29 18:32:30 +08:00
Boshen
7236368d5a
feat(prettier): implement is_next_line_empty_after_index (#1575) 2023-11-29 14:37:33 +08:00