Boshen
49fab9d6be
Release npm/oxc-transform v0.15.1
2024-06-20 23:41:31 +08:00
Boshen
f8fe583a0b
ci: run cargo check first
2024-06-20 23:38:21 +08:00
Boshen
0511a1b014
chore(justfile): run cargo shear in just ready
2024-06-20 23:27:46 +08:00
Boshen
4f2f96e716
chore(napi/transform): remove unused dependencies
2024-06-20 23:26:57 +08:00
Boshen
05e97b615d
chore: fix clippy warning
2024-06-20 23:22:01 +08:00
Boshen
25b607cde1
ci: fix
2024-06-20 23:18:42 +08:00
Boshen
fe38a20715
refactor(napi/transform): output normal error messages
2024-06-20 23:14:17 +08:00
Boshen
152195b67b
ci: try fix graphite optimize ci
2024-06-20 23:14:17 +08:00
Dunqing
a37138f1ec
feat(isolated-declarations): improve the inference template literal ( #3797 )
2024-06-20 15:02:45 +00:00
Dunqing
b0d7355c98
feat(isolated-declarations): transform const expression correctly ( #3793 )
2024-06-20 15:02:41 +00:00
Boshen
2a16ce0624
feat(traverse): disable syntax check and disable build module record ( #3794 )
...
These can be skipped because :
* semantic errors are not passed to the caller
* module record is not used
2024-06-20 13:05:35 +00:00
Dunqing
01da2f78c1
feat(codegen): print TSThisParameter for TSCallSignatureDeclaration and TSMethodSignature ( #3792 )
2024-06-20 10:13:58 +00:00
Dunqing
2821e0e307
feat(codegen): print readonly keyword for TSIndexSignature ( #3791 )
2024-06-20 10:13:51 +00:00
Dunqing
7d47fc3fcc
fix(isolated-declarations): should stripe async and generator keyword after transformed ( #3790 )
2024-06-20 10:13:44 +00:00
Dunqing
dc8e2b8dc0
feat(coverage/transpile): compare error message ( #3789 )
2024-06-20 10:13:36 +00:00
Boshen
ebb6eb8c67
chore(coverage): add a prepass benchmark
2024-06-20 15:07:17 +08:00
Alexander S
a5e0f2274a
fix(docs): detect typescript alias rules and mark them as supported ( #3779 )
...
Some tpyescript rules are extensions of the core eslint rules.
Now we mark them as supported :)
Maybe add a info for the user about this behavior?
Some discord discussion:
https://discord.com/channels/1079625926024900739/1080712072012238858/1226407188650659845
## Current State
Found Aliases:
- default-param-last
- max-params
- no-array-constructor
- require-await
- no-dupe-class-members
- no-empty-function
- no-loss-of-precision
- no-redeclare
- no-useless-constructor
Todo: why im getting following output:
```
👀 typescript/require-await is implemented but not found in their rules
👀 tree-shaking/no-side-effects-in-initialization is implemented but not found in their rules
```
2024-06-20 14:56:31 +08:00
overlookmotel
24df88099a
ci: enable semantic benchmarks ( #3784 )
...
#3776 does seem to have stabilized the benchmark results. Re-enable
semantic benchmarks which we disabled because they were showing wild
variance, and see if they still do.
2024-06-20 14:55:33 +08:00
Boshen
a94ef68c0f
ci: add JEMALLOC_SYS_WITH_LG_PAGE=16 to aarch64 systems
...
closes #3783
2024-06-20 14:30:17 +08:00
Dunqing
97575d8cab
feat(codegen): print TSClassImplements and TSThisParameter ( #3786 )
...
close: https://github.com/oxc-project/oxc/issues/3692#issuecomment-2178994839
2024-06-20 06:15:23 +00:00
Dunqing
497769cb60
feat(ast): add some visitor functions ( #3785 )
2024-06-20 05:23:04 +00:00
overlookmotel
aea3e9a3f5
fix(transformer): correct spans for TS annotations transform ( #3782 )
...
Correct spans in output for TS annotations transform.
2024-06-20 01:33:12 +00:00
overlookmotel
21b0d0196b
refactor(transformer): pass ref to function ( #3781 )
...
Tiny refactor. Pass `&TSEnumDeclaration` to function instead of `&Box<TSEnumDeclaration>` (which is a reference to a reference).
2024-06-20 01:33:09 +00:00
rzvxa
4bd2c882d3
fix(linter): fix and promote getter-return to correctness. ( #3777 )
...
I had to rewrite some parts of this rule so now it uses a set dfs. It is arguably a little bit slower than before but it is less prone to false negatives.
closes #2312
[oxlint-ecosystem-ci](https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/9586832129/job/26435575457?pr=16 )
2024-06-20 01:27:07 +00:00
rzvxa
3e78f9852f
feat(cfg): add depth first search with hash sets. ( #3771 )
...
petgraph allocates a chunk of memory for all of the graph for its dfs which is really costly for small subgraph sreachs.
This PR adds a new `set_depth_first_search` function which uses a `FxHashSet` instead.
2024-06-20 01:27:03 +00:00
overlookmotel
6ba60e978a
ci: custom global allocator for benchmarks ( #3776 )
...
Use a custom global allocator for benchmarks. Will hopefully fix the wild variance in many benchmarks that we've been seeing, which I believe is caused by unpredictable behavior in the system allocator.
2024-06-19 17:02:19 +00:00
Boshen
ae6654f247
ci: speed up conformance with thin lto ( #3773 )
2024-06-19 16:05:06 +00:00
Dunqing
4b06dc72ae
feat(ast): add TSType::TSIntrinsicKeyword to is_keyword ( #3775 )
...
follow up #3767
2024-06-19 16:00:57 +00:00
overlookmotel
7c44703a4c
refactor(transformer): remove needless pub on TS enum transform methods ( #3774 )
...
Tiny refactor. Remove `pub` visibility on methods not used outside of module.
2024-06-19 15:51:04 +00:00
Dunqing
b38c34dfce
feat(isolated-declarations): support inferring ParenthesizedExpression ( #3769 )
2024-06-19 15:43:21 +00:00
Dunqing
8ce794d740
fix(isolated-declarations): inferring an incorrect return type when there is an arrow function inside a function ( #3768 )
2024-06-19 15:43:15 +00:00
rzvxa
315f9ad9bf
chore(ci): add A-cfg label to auto-labler. ( #3772 )
...
I have already added the `A-cfg` label if you don't want to merge this
please also remove the said label.
2024-06-19 23:23:31 +08:00
Boshen
a658ca8675
ci: try graphite ci optimizer ( #3770 )
2024-06-19 23:07:35 +08:00
Boshen
5847e16a15
feat(ast,parser): add intrinsic keyword ( #3767 )
...
closes #3759
2024-06-19 14:52:05 +00:00
rzvxa
1190dee47f
fix(linter): false positives with setters in the getter-return rule. ( #3714 )
...
related but won't close #2312
[oxlint-ecosystem-ci](https://github.com/rzvxa/oxlint-ecosystem-ci/actions/runs/9547942249/job/26314030884 )
2024-06-19 14:45:06 +00:00
Dunqing
4134de8dcf
feat(isolated-declarations): add ts error code to the error message ( #3755 )
2024-06-19 14:33:29 +00:00
Dunqing
94202de250
feat(isolated-declarations): add export {} when needed ( #3754 )
...
https://github.com/microsoft/TypeScript/pull/58912
2024-06-19 14:33:27 +00:00
Dunqing
d29316a5ff
fix(isolated-declarations): transform incorrectly when there are multiple functions with the same name ( #3753 )
2024-06-19 14:33:25 +00:00
Dunqing
e95d8e3990
feat(isolated-declarations): shrink span for arrow function that needs an explicit return type ( #3752 )
...
Current `span` we can't be consistent with typescript.
We report the following
```ts
(a, b) =>
^^^^^^^^^
{ }
^
```
TypeScript reports the following
```ts
(a, b) =>
^^^^^^^^^
{}
```
The TypeScript only reports the first line, if we want it to be exactly the same we need to find the first newline position
2024-06-19 14:33:24 +00:00
Dunqing
bf1c250d56
fix(isolated-declarations): false positives for non-exported binding elements ( #3751 )
2024-06-19 14:06:08 +00:00
Dunqing
df9971da4c
feat(isolated-declarations): improve inferring the return type from function ( #3750 )
2024-06-19 14:06:05 +00:00
Dunqing
4aea2b158c
feat(isolated-declarations): improve inferring the type of accessor ( #3749 )
2024-06-19 14:06:02 +00:00
Dunqing
9ea30c41ff
feat(isolated-declarations): treat AssignmentPattern as optional ( #3748 )
2024-06-19 14:05:59 +00:00
rzvxa
887da40518
test(linter): enable no-fallthrough test with disable-next-line. ( #3766 )
...
I thought we didn't have this, But now that I've read the `LintContext` I have realized it wasn't true.
2024-06-19 13:24:21 +00:00
rzvxa
4d2b7f1227
refactor(linter): LintContext can now only be constructed with a cfg enabled semantic. ( #3761 )
...
It has the same spirit as #3747 but with a much simpler approach. I've used the fact that @Boshen mentioned about linter always using CFG so now we assert `semantic.cfg().is_some()` in the `LintContext::new` because of this assertion we can have a `LintContext::cfg` that unwraps unchecked.
Eliminates unnecessary checks in our hot paths.
It has the best of both worlds, No complicated typing yet we still get the CFG as a non-optional value without extra ASM or branching.
2024-06-19 13:01:33 +00:00
Boshen
4fb90eb009
feat(oxc): export isolated-declarations ( #3765 )
2024-06-19 12:54:02 +00:00
overlookmotel
22c56d73c3
refactor(transformer): move TSImportEqualsDeclaration transform code ( #3764 )
...
Pure refactor. Move all code related to `TSImportEqualsDeclaration` transform into `module.rs`.
2024-06-19 12:48:44 +00:00
overlookmotel
cd56aa9dd8
refactor(transformer): simplify TS export assignment transform ( #3762 )
...
Remove unnecessary jump through a `ModuleDeclaration` visitor, and visit as `TSExportAssignment` directly.
2024-06-19 12:31:02 +00:00
overlookmotel
512740d33d
refactor(transformer): move and simplify TS enum transform entry point ( #3760 )
...
Move logic for TS enum transform into `enum.rs`. Also simplify the logic, using `Statement` enum variants directly.
2024-06-19 12:16:30 +00:00
Boshen
bd534375a1
chore: update MAINTENANCE.md
2024-06-19 20:13:12 +08:00