Commit graph

3048 commits

Author SHA1 Message Date
Ali Rezvani
198eea0bce
refactor(ast): add walk functions to Visit trait. (#2791)
closes #2442
2024-03-25 10:44:29 +08:00
Dunqing
b28b61774b
fix(semantic): incorrect ExportEntry span for ExportAllDeclaration in ModuleRecord (#2793)
Now the span is ExportAllDeclaration's span
2024-03-25 10:32:02 +08:00
renovate[bot]
525031b7a2
chore(deps): update rust crates (#2802) 2024-03-25 09:47:26 +08:00
renovate[bot]
2500947114
chore(deps): update dependency vite to v5.2.6 (#2801) 2024-03-25 04:52:45 +08:00
renovate[bot]
890144f464
chore(deps): update dependency express to v4.19.1 (#2800) 2024-03-24 20:51:37 +00:00
Dunqing
398a0346b3
feat(transformer/typescript): remove verbatim_module_syntax option (#2796)
Remove `verbatim_module_syntax` option, Because Babel's
[onlyRemoveTypeImports](https://babeljs.io/docs/babel-plugin-transform-typescript#onlyremovetypeimports)
option same behavior with `verbatim_module_syntax` , You can see
https://github.com/babel/babel/issues/15493#issuecomment-1466453493
2024-03-25 04:51:23 +08:00
Dunqing
b6e493bd78
fix(semantic): ModuleRecord's indirect_export_entires missing reexported imports (#2792)
local_name has `name` and `span`. We can't directly compare
ExportEntry's local_name and ImportEntry's local_name. because the span
is never equal.
2024-03-25 04:50:04 +08:00
renovate[bot]
7b6a4d0690
chore(deps): update vscode npm packages (#2799) 2024-03-25 04:47:59 +08:00
renovate[bot]
36e63142d5
chore(deps): update dependency tar to v6.2.1 (#2798) 2024-03-25 04:45:54 +08:00
Ali Rezvani
813226b648
refactor(ast): get rid of unsafe transmutation in VisitMut trait. (#2764)
This will close #2745,

In this PR I attempt to fix this issue using a combination of ideas
discussed in the issue mentioned above, I've created this early draft so
people can pitch in if there is something I should consider doing.

The first goal of this PR is to resolve the issue with the possible
illegal references, As a result of my approach it would also end up with
a bunch of walk_* and walk_*_mut functions to help with the abstraction.
I want to eliminate enter_node and leave_node functions, but I still
haven't started working on it since I first want to familiarize myself
with all of its usage throughout the project. I'm hesitating to do it at
the moment, When we want to do this it would require quite a bit of
refactoring so we should make sure it is probably going to work and end
up being a better implementation.
2024-03-23 13:48:30 +00:00
underfin
d9b77d853b
refactor(sourcemap): change sourcemap name to take a reference (#2779) 2024-03-23 21:40:05 +08:00
Dunqing
712b3d2a11
feat(semantic): distinguish type imports in ModuleRecord (#2785)
I am not sure moving `ImportOrExportKind` to `oxc-syntax` is a good
solution.
2024-03-23 21:38:17 +08:00
Yuji Sugiura
4a42c5fd7d
refactor(semantic/jsdoc): JSDocTag parser rework (#2765)
Address
https://github.com/oxc-project/oxc/pull/2642#issuecomment-2001950723


0fd67cb874/crates/oxc_semantic/src/jsdoc/parser/jsdoc_tag.rs (L3-L25)
2024-03-23 00:16:59 +08:00
Dunqing
7d604e57b0
feat(playground): display referenceId in symbol tab (#2790)
<img width="642" alt="image"
src="https://github.com/oxc-project/oxc/assets/29533304/e87893d9-9d21-4300-9028-1ef3e546777a">
2024-03-23 00:09:08 +08:00
underfin
dc3f6e7570
chore: update sourcemap 8.0.0 (#2788) 2024-03-22 21:52:21 +08:00
overlookmotel
29d8a64bc9
perf(tasks): speed up NAPI parser benchmark build (#2787)
The `parser_napi` pseudo-benchmark does not depend on any Oxc crates, so
remove all dependencies for this benchmark. This reduces build time of
this benchmark on CI by ~1 minute.

After #2780, NAPI parser benchmark sometimes took the longest of all the
benchmarks, so making it faster reduces time to complete the benchmarks
overall.
2024-03-22 12:09:32 +00:00
overlookmotel
87348bd005
chore(napi): correct bench NPM script (#2786)
NAPI benchmarks now use Tinybench. NPM script was wrong.
2024-03-22 10:13:51 +00:00
overlookmotel
919a5061a2
chore(tasks): remove dummy comment (#2784)
Had to add this dummy comment to get CI to run on #2783. So now removing
it again.
2024-03-21 23:37:33 +00:00
overlookmotel
2fe158d0d6
refactor(tasks): separate NAPI benchmark CI job (#2783)
Not a substantive change. This just prevents the other benchmark jobs
showing greyed-out "Build NAPI benchmark" steps, and makes the workflow
file easier to follow.

CI tasks were stuck at "Waiting for status to be reported", and unable
to merge until they passed. Problem was that CI task doesn't run if only
`.yml` files are altered. So have added a dummy comment to a random Rust
file just to get it to run. Will make another PR after to remove the
comment again!
2024-03-21 23:30:38 +00:00
Boshen
ef1108a749
chore: Rust v1.77.0 (#2781) 2024-03-21 17:21:57 +00:00
overlookmotel
2c0a7d6c23
fix(tasks): reduce variance of NAPI benchmarks (#2780)
Reduce variance in NodeJS/NAPI benchmarks by running them for longer.
2024-03-21 16:21:44 +00:00
Andi Pabst
4c5abb590e
feat(cli): wildcard expansion in paths for windows (#2767)
Unlike on other OS, on Windows there is no wildcard expansion/globbing
by the shell. Instead the application has to handle this. Therefore I
used the `glob` package to handle wildcards on Windows.

I also had to make the parent directory check more strict due to the
glob package resolving `..` in the middle of the path as well.

This closes #2695.
2024-03-22 00:21:30 +08:00
Wang Wenzhe
64e4de7861
fix(linter/max-lines): only report codes that exceed the line limit (#2778)
closes: #2775
2024-03-21 20:46:21 +08:00
underfin
a2cfc867cb
feat: SourcemapVisualizer (#2773)
Export `SourcemapVisualizer` from codegen, it will be used oxc and
rolldown sourcemap test, so it support multiply source print, it will
using sourcemap `sourcesContent` as original source.
2024-03-21 11:19:09 +08:00
Wang Wenzhe
3c9e77d66f
feat(linter/tree-shaking): detect CallExpression in MemberExpression (#2772) 2024-03-20 23:11:45 +08:00
Dunqing
e10ef03aa9
feat(linter/import) support check re-export in named (#2769) 2024-03-20 22:12:45 +08:00
Danil Karpenko
1721feea0e
feat(prettier/ts): better conformance (#2721)
I know 5% isn't much, but it's small steps like this that move us toward
our goal.
2024-03-20 18:59:49 +08:00
Jose
451162effc
feat(linter): eslint/no-iterator (#2758)
Rule detail: https://eslint.org/docs/latest/rules/no-iterator

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-20 16:20:09 +08:00
keita hino
53ffbc6bd2
feat(linter): eslint-plugin-react checked-requires-onchange-or-readonly (#2754)
partof: https://github.com/oxc-project/oxc/issues/1022

docs:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
code:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/checked-requires-onchange-or-readonly.js
test:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/checked-requires-onchange-or-readonly.js

---------

Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-03-20 15:38:48 +08:00
overlookmotel
508091314f
feat(tasks): benchmark NodeJS parser (#2770)
Add NodeJS parser to benchmarks.

Previous attempt #2724 did not work due CodSpeed producing very
inaccurate results (https://github.com/CodSpeedHQ/action/issues/96).

This version runs the actual benchmarks without CodSpeed's
instrumentation. Then another faux-benchmark runs within Codspeed's
instrumented action and just performs meaningless calculations in a loop
for as long as is required to take same amount of time as the original
uninstrumented benchmarks took.

It's unfortunate that we therefore don't get flame graphs on CodSpeed,
but this seems to be the best we can do for now.
2024-03-20 05:06:09 +00:00
Jose
1c07a9908d
feat(linter): default_param_last (#2756)
Rule detail: https://eslint.org/docs/latest/rules/default-param-last

---------

Co-authored-by: j.buendia <j.buendia>
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-03-20 10:05:51 +08:00
Jose
291dc0597c
feat(linter): no_script_url (#2761)
Rule detail: https://eslint.org/docs/latest/rules/no-script-url

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-20 09:09:34 +08:00
Dunqing
99dcd00bf3
feat(linter/import) change the rule path to index.ts and add snapshot in export rule (#2732)
Looks like the current implementation is incorrect
2024-03-19 22:47:04 +08:00
Jose
ac813a60f6
feat(linter): no_template_curly_in_string (#2763)
Rule detail:
https://eslint.org/docs/latest/rules/no-template-curly-in-string

At first I implemented it with regex, but I think you are trying to
avoid it for performance reasons, so I did it by searching for the
chars.

I had some problems showing the span in the case of 'Hello, ${{foo:
"bar"}.foo}' I think it turned out more or less well, however, if you
think it can be done in another way I am willing to do it .

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-19 21:56:36 +08:00
Jose
134e15e657
feat(linter): eslint/no-proto (#2760)
Rule detail: https://eslint.org/docs/latest/rules/no-proto

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-19 20:01:15 +08:00
Jose
39b98badca
feat(linter): no_eq_null (#2757)
Rule detail: https://eslint.org/docs/latest/rules/no-eq-null

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-19 15:48:25 +08:00
Jose
a671d754df
fix(linter): fix guard_for_in span error (#2755)
As talked here
https://github.com/oxc-project/oxc/pull/2746#discussion_r1528145418
errors in guard_for_in could be improved so I attempted to improve it.

If anyone have a suggestion for the span element positions say me!

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-19 12:16:30 +08:00
Jose
86d006e171
feat(linter): eslint/max-params (#2749)
Rule detail: https://eslint.org/docs/latest/rules/max-params

Maybe I can add function name, I was searching for it, but I don't know
how to get it.

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-19 09:16:52 +08:00
overlookmotel
b82a5dd123
fix(tasks): don't upload log files to CodSpeed (#2762)
Improvement to #2751. CodSpeed have advised no need to upload the log
files.
2024-03-18 22:44:57 +00:00
overlookmotel
5edd196836
fix(tasks): fix codspeed upload for PRs from forks (#2759)
#2751 contained a mistake, which was pointed out by Adrian @ CodSpeed on
Discord.

For PRs from forks, `CODSPEED_TOKEN` is not provided, and the submission
to CodSpeed is "tokenless". #2751 wrongly assumed all runs are submitted
with a token. This PR fixes that.
2024-03-18 20:29:16 +00:00
Danil Karpenko
31efbc29fc
feat(prettier/ts): print type keyword inside import specifier braces, fixes #2708 (#2712)
- #2708
2024-03-18 20:54:19 +08:00
overlookmotel
e793063f75
perf(parser): faster lexing JSX identifiers (#2557)
Speed up lexing JSX identifier continuations (i.e. after `-`), by
searching for end of identifier byte-by-byte.

Change does not register on benchmarks, only because benchmarks don't
contain any `<Foo-Bar />` identifiers, so don't exercise this code path.
2024-03-18 12:06:27 +00:00
Jose
22c84c546a
feat(linter): eslint/guard-for-in (#2746)
Rule details: https://eslint.org/docs/latest/rules/guard-for-in

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-18 19:36:26 +08:00
Dunqing
95ac265504
feat(linter/import): check ObjectPattern syntax in namespace (#2691) 2024-03-18 12:55:55 +08:00
Dunqing
64db5643ce
feat(linter/import) implement no_unused_modules rule (#2720) 2024-03-18 12:55:36 +08:00
renovate[bot]
938debab71
chore(deps): update website npm packages (#2750) 2024-03-18 12:53:43 +08:00
Boshen
b1343d7bcb
Release oxlint and vscode extension v0.2.14 2024-03-18 12:47:53 +08:00
overlookmotel
68f304faa3
feat(tasks): shard linter benchmarks in CI (#2752)
Follow-on from #2751. Further shards linter benchmarks so each fixture runs in its own job.

This reduces total time to run benchmarks by another ~75 secs. So approx 2.5 mins shaved off in total.
2024-03-18 10:50:44 +08:00
overlookmotel
93e1ea4419
feat(tasks): shard benchmarks in CI (#2751)
This PR shards benchmarks when running on CI. Each benchmark (parser, minifier etc) runs as a separate job, and then a final job combines the results and uploads to Codspeed.

A bit of a hacky implementation. Uses a small NodeJS HTTP server to intercept the results from `codspeed-runner`, and then another NodeJS script to combine them all together, and upload to CodSpeed.

I will submit PRs on Codspeed's runner + action to do it properly, but as I imagine it'll be a slow process getting that merged upstream, I wanted to see if it worked first. We can replace this once it's supported upstream.

Sharding only reduces total time to run the benchmarks by about 70 secs at present, because linter benchmark takes 6 mins alone and holds up the whole process (all the rest are done in ~2 mins). If we can split up the linter benchmark, we can likely get total run time down to around 3 mins. I'll try that in a follow-on PR.

I guess the other upside is we can now add as many benchmarks as we like with impunity - they'll run in parallel, and so won't slow things down overall.
2024-03-18 10:45:44 +08:00
renovate[bot]
e146b8d3c4
chore(deps): update vscode npm packages (#2748) 2024-03-17 16:41:40 +00:00