Commit graph

3217 commits

Author SHA1 Message Date
Boshen
9643cba4a4
feat(transform_conformance): drop all babel 7 specific tests (#2982)
@Dunqing Is this correct?
2024-04-14 23:02:38 +08:00
Boshen
c753c9fa74
feat(transform_conformance): handle deserialization errors (#2980) 2024-04-14 22:47:28 +08:00
Jose
627dd424cb
fix(linter/no-empty-interface): add missing test (#2979)
As requested add new test
https://github.com/oxc-project/oxc/pull/2973#discussion_r1564728188

---------

Co-authored-by: j.buendia <j.buendia>
2024-04-14 22:33:59 +08:00
Boshen
b6b63ac9bc
feat(transform_conformance): skip tests with plugin.js (#2978) 2024-04-14 21:55:32 +08:00
Boshen
7cf0927a38
feat(transform_conformance): skip tests with plugin.js (#2977) 2024-04-14 21:45:27 +08:00
Boshen
c211f1e57f
feat(transformer): add diagnostics to react transform (#2974) 2024-04-14 21:42:32 +08:00
Boshen
ef602af4cc
feat(transform_conformance): skip plugins we don't support yet (#2967) 2024-04-14 21:32:03 +08:00
Jose
aa62dbbfd5
feat(linter): add missing test cases to no-empty-interface and add config (#2973)
Based on this https://github.com/oxc-project/oxc/issues/2934 I added
missing test cases and rule configuration

---------

Co-authored-by: j.buendia <j.buendia>
2024-04-14 12:12:28 +00:00
Boshen
c7e70c80f0
fix(transformer): deserialize ReactJsxRuntime with camelCase (#2972) 2024-04-14 19:40:24 +08:00
Boshen
3a6eae1abd
feat(transformer): apply jsx self and source plugin inside jsx transform (#2966) 2024-04-14 19:10:59 +08:00
Boshen
10814d5331
fix(transformer): turn on react preset by default (#2968) 2024-04-14 19:04:59 +08:00
Boshen
d57526103c
feat(coverage): add transformer to prevent crashes (#2970) 2024-04-14 18:52:51 +08:00
Boshen
35e3b0f1cb
fix(transformer): fix incorrect jsx whitespace text handling (#2969) 2024-04-14 18:40:40 +08:00
Wang Wenzhe
5b02ae1175
feat(linter/tree-shaking): support ConditionalExpression (#2965) 2024-04-14 13:41:44 +08:00
Wang Wenzhe
da5ea411dd
feat(linter/tree-shaking): support Class (#2964) 2024-04-14 13:39:27 +08:00
Boshen
bd9fc6d169
feat(transformer): react jsx transform (#2961) 2024-04-14 10:50:17 +08:00
Cameron
01e64bf64d
feat(linter) eslint-plugin-unicorn no await in promise methods (#2963) 2024-04-14 10:44:36 +08:00
Cameron
98a3acd8b5
feat(linter) eslint-plugin-unicorn no single promise in promise methods (#2962)
part of #684
2024-04-14 10:39:12 +08:00
Boshen
6561392202
feat(transform_conformance): add baseline for all TypeScript and jsx plugins 2024-04-13 19:05:39 +08:00
Miles Johnson
e67355045e
feat(transformer): start on TypeScript annotation removal (#2951) 2024-04-13 18:49:54 +08:00
Boshen
93ce5a919a
chore: fix internal doc warnings 2024-04-13 15:59:24 +08:00
Boshen
9df5001543
ci: explicitly disable incremental build and deny warnings for cargo and rust 2024-04-13 15:40:10 +08:00
Boshen
21509ae15b
chore: disable profile.dev debug symbols because we don't need it that much 2024-04-13 15:38:19 +08:00
Boshen
56c71e2b1e
chore: enable some rust lints 2024-04-13 15:38:00 +08:00
Boshen
b15bf2826b
feat(napi/parser): remove experimental flexbuffer api (#2957) 2024-04-13 14:59:31 +08:00
renovate[bot]
071010964e
chore(deps): update dependency rust to v1.77.2 (#2956) 2024-04-13 06:19:38 +00:00
Boshen
51e1fe32e5
chore: fix rust toolchain update not working 2024-04-13 14:12:10 +08:00
Boshen
bd56d51443
chore(macros): only select required features from syn to reduce compile time (#2955) 2024-04-13 13:37:59 +08:00
Boshen
f366d9bd7c
chore(minsize): remove brotlic because it takes too long to compile (#2954) 2024-04-13 13:24:25 +08:00
Boshen
adabbac696
ci: only run cargo-shear when Rust changes (#2953) 2024-04-13 13:24:09 +08:00
Boshen
003c2960c6
chore: add auto rust-toolchain.toml version update 2024-04-13 12:58:35 +08:00
Boshen
063b281c39
feat(allocator): make Box's PhantomData own the passed in T (#2952) 2024-04-13 12:31:40 +08:00
Boshen
e651e50bda
feat(transformer): add the most basic plugin toggles (#2950) 2024-04-12 20:25:34 +08:00
Boshen
60ccbb105c
refactor(transformer): clean up some code (#2949) 2024-04-12 20:23:44 +08:00
Boshen
14754777a4
feat(transformer): implement react-jsx-source (#2948) 2024-04-12 20:21:54 +08:00
Boshen
b05c26374c
ci: fix codecov stack overflow by increasing the stack size
The underlying cause is oxc_prettier recursively printing assignment expressions.
2024-04-12 20:17:53 +08:00
branchseer
f159f60084
Make ast types covariant over the allocator lifetime. (#2943)
## Why

Due to the usage of `&'alloc mut T` in `oxc_allocator::Box`, and
`bumpalo::collections::Vec` in `oxc_allocator::Vec`, ast types are
currently invariant over their allocator lifetime `'a`. This prevents
`ouroboros` from generating `borrow_*` on ast type fields, leading to
the unfriendly `with_*` api:
c250b288ef/crates/oxc_parser/examples/multi-thread.rs (L82-L84)

## How

- For `oxc_allocator::Vec`, switch to `allocator_api2::vec::Vec`, which
has a covariant relationship with the allocator lifetime.
- For `oxc_allocator::Box`, use `std::ptr::NonNull` which is
specifically designed to be covariant. I don't use
`allocator_api2::boxed::Box` because it holds the allocator for
dropping, so the size is bigger.

## Downside

Now that `oxc_allocator::Box` uses the unsafe `NonNull`. It has to be a
private field to be safe. This make it impossible to do `Box(....)`
pattern matching.
2024-04-12 18:12:18 +08:00
Boshen
f903a225a8
feat(transformer): implement react-jsx-self (#2946) 2024-04-12 18:08:36 +08:00
Yuji Sugiura
ba2121f17d
feat(linter): Add --jsdoc-plugin flag (#2935)
Add flag to:

```sh
$ oxlint --jsdoc-plugin
```


![image](https://github.com/oxc-project/oxc/assets/6259812/0e12ceab-966f-47e1-b4b9-5bc2eb6bdb56)
2024-04-12 10:39:12 +08:00
Boshen
0c04bf743f
feat(transformer): transform TypeScript namespace (#2942) 2024-04-12 10:19:13 +08:00
Boshen
c250b288ef
fix(cli): return error if --format receives an unknown value 2024-04-11 21:38:39 +08:00
Boshen
f3a28c61b9
chore(transform_conformance): enable typescript plugin snapshot 2024-04-11 20:06:53 +08:00
Boshen
3419306ac0
feat(transformer): add filename (#2941) 2024-04-11 18:43:51 +08:00
Boshen
df11d10a22
Release oxlint and vscode extension v0.2.17 2024-04-11 16:27:56 +08:00
Boshen
614f73b66c
Release crates v0.12.3 2024-04-11 16:18:17 +08:00
Boshen
ced0721b3b
ci: cache codecov; enable code coverage for oxc_transformer 2024-04-11 16:16:02 +08:00
Boshen
98bf7e6767
fix(cli): fix oxlint --format json yields 0 files to lint (#2940)
closes #2930
2024-04-11 16:03:31 +08:00
Boshen
02adc76760
feat(transformer): implement plugin-transform-react-display-name top-down (#2937)
Missing case:


https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-react-display-name/test/fixtures/display-name/nested/input.js

```js
var foo = qux(createReactClass({}));
var bar = qux(React.createClass({}));
```

This requires recursing down.

Top-down implementation in swc:


67ec5e09b9/crates/swc_ecma_transforms_react/src/display_name/mod.rs (L108-L132)

Or bottom-up in babel:


08b0472069/packages/babel-plugin-transform-react-display-name/src/index.ts (L87-L98)
2024-04-11 15:32:32 +08:00
Boshen
59748199da
refactor(ast): clean up the ts type visit methods 2024-04-11 15:26:24 +08:00
Boshen
88270fe605
chore(benchmark): use a larger file for sourcemap benchmark 2024-04-11 15:11:26 +08:00