Commit graph

3125 commits

Author SHA1 Message Date
Boshen
54f7cd3978
Release crates v0.11.1 2024-04-03 16:57:52 +08:00
Boshen
a5196be341
chore: Rust v1.77.1 2024-04-03 16:50:29 +08:00
Boshen
ae4f474bab
ci: run cargo check with --all-features 2024-04-03 16:43:50 +08:00
underfin
114f68ea7c
refactor(codegen): make codegen sourcemap builder clearer (#2894)
Avoid `enable_sourcemap` appear multiply times.
2024-04-03 15:07:19 +08:00
cinchen
7bc638ee7d
feat(linter): eslint-plugin-jest/prefer-mock-promise-sorthand (#2864)
part of #492 

Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-mock-promise-shorthand.ts)
2024-04-03 12:17:34 +08:00
underfin
28fae2e80a
fix(sourcemap): using serde_json::to_string to quote sourcemap string (#2889) 2024-04-03 12:14:45 +08:00
Boshen
21a5e4433f
fix(transformer): add serde "derive" feature to fix compile error 2024-04-03 11:56:27 +08:00
underfin
64c4b825f1
chore: improve sourcemap visualizer (#2886)
The pr intend to improve `SourcemapVisualizer` log mapping.

- add the mapping for last token to final position of source
- fix token mapping
2024-04-03 10:45:00 +08:00
Wang Wenzhe
ce34829521
feat(linter/tree-shaking): support ThisExpression and NewExpression (#2890) 2024-04-03 10:43:09 +08:00
Don Isaac
d3eb1c3318
fix(semantic): flag function expressions with SymbolFlags::Function (#2891)
# What This PR Does

Consider the following code snippet

```js
const x = function y () {{
```

`y` will now be flagged with `SymbolFlags::Function`. This follow's
tsc's behavior.

- [Example in OXC
Playground](https://oxc-project.github.io/oxc/playground/?code=3YCAAICagICAgICAgICxG0qZRraXZOpcCHVsSRwDq2kRR0HprsTfRRT5WMw%2Ff2epoIA%3D)
- [Example in TypeScript AST
Viewer](https://ts-ast-viewer.com/#code/MYewdgzgLgBAHjAvDAZgVzMKBLcMCeAFAJQwDeAvgFBA)
2024-04-03 10:42:11 +08:00
Boshen
93897c530c
chore: bump syn to v2 (#2888) 2024-04-02 20:57:09 +08:00
Boshen
c767a2ede0
ci: fix ecosystem-ci build 2024-04-02 17:47:05 +08:00
Boshen
d63127d009
chore: only build the allocators in release mode because they are slow to build (60s) 2024-04-02 17:39:01 +08:00
Boshen
a0532adc65
chore: bump criterion2, which removes clap and 10s compile time 2024-04-02 16:48:40 +08:00
Boshen
4b28d46fc4
chore: fix typos by ignoring no_unknown_property.rs 2024-04-02 16:27:38 +08:00
Wang Wenzhe
15d08f6635
feat(linter/tree-shaking): support ArrowFunctionExpression (#2883) 2024-04-02 10:34:32 +08:00
Wang Wenzhe
4a86dcb322
feat(linter/tree-shaking): support ArrayExpression and ArrayPattern (#2882) 2024-04-02 10:33:07 +08:00
Boshen
23d3c4e0a4
chore: add changelogs via git cliff (#2878)
This is generated alongside https://github.com/oxc-project/release-oxc
2024-04-01 20:04:48 +08:00
renovate[bot]
e76d70ffbf
chore(deps): lock file maintenance (#2880) 2024-04-01 11:43:44 +08:00
Ali Rezvani
5f8f7f8d2f
fix(ast): FinallyClause won't get visited as BlockStatement anymore. (#2881)
This would fix the issue found in #2877,

As it is right now, the `FinallyClause` gets visited 2 times, once as
the Finally and once as a block.

This PR addresses this issue by making the `visit_finally_clause` method
visit the body statements instead of visiting the block itself. Now it
works similar to the `CatchClause`.
2024-04-01 10:25:50 +08:00
renovate[bot]
619fc61e95
chore(deps): update dependency express to v4.19.2 (#2879)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [express](http://expressjs.com/)
([source](https://togithub.com/expressjs/express)) | [`4.19.1` ->
`4.19.2`](https://renovatebot.com/diffs/npm/express/4.19.1/4.19.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/express/4.19.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/express/4.19.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/express/4.19.1/4.19.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/express/4.19.1/4.19.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>expressjs/express (express)</summary>

###
[`v4.19.2`](https://togithub.com/expressjs/express/blob/HEAD/History.md#4192--2024-03-25)

[Compare
Source](https://togithub.com/expressjs/express/compare/4.19.1...4.19.2)

\==========

-   Improved fix for open redirect allow list bypass

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-01 00:27:55 +08:00
Boshen
3ca6721783
ci: always run cargo shear 2024-03-31 16:06:22 +08:00
Boshen
7710d8caf1
feat(transformer): add compiler assumptions (#2872)
closes #2869
2024-03-31 02:04:21 +00:00
Boshen
7034bcc47d
feat(transformer): add proposal-decorators (#2868) 2024-03-30 21:07:36 +08:00
Boshen
ffadcb08d9
feat(transformer): add react plugins (#2867) 2024-03-30 20:56:10 +08:00
Boshen
293b9f482a
feat(transformer): add transform-typescript boilerplate (#2866) 2024-03-30 20:48:35 +08:00
Boshen
c1a2958a5a
chore: remove oxc_transformer for a reimplementation (#2865)
closes #2860
2024-03-30 17:19:46 +08:00
Boshen
31ed532b79
Release crates v0.11.0 2024-03-30 13:54:53 +08:00
Boshen
52a9f08a57
chore: remove release-plz 2024-03-30 13:50:41 +08:00
Boshen
e7307ed23c
Release oxlint and vscode extension v0.2.15 2024-03-30 13:34:38 +08:00
Boshen
ec0bb077ca
chore(linter): change rule category for some of the new rules 2024-03-30 13:26:33 +08:00
Boshen
348c3e9bb3
ci: rename and tweak publish crates action 2024-03-30 13:20:29 +08:00
Dunqing
df628289ff
fix(linter/import): ignore export declaration in no-duplicates (#2863) 2024-03-30 12:57:43 +08:00
Dunqing
c4528974cb
fix(linter/import): false positive for indirect export in namespace (#2862) 2024-03-30 12:55:51 +08:00
Dunqing
23651980d1
feat(cli): add tsconfig file validation in LintRunner (#2850) 2024-03-29 19:56:30 +08:00
Dunqing
76cc90684a
feat(linter/import): ignore type-only imports and exports in no_unresolved (#2849)
fa60e3d738/src/rules/no-unresolved.js (L32-L35)
2024-03-29 19:54:45 +08:00
Dunqing
1b5e544a36
refactor(semantic): distinguish whether requested_modules is type imports/exports (#2848) 2024-03-29 19:52:30 +08:00
underfin
6177c2f7ef
fix(codegen): sourcemap token name should be original name (#2843)
close https://github.com/oxc-project/oxc/issues/2753.
2024-03-28 20:14:10 +08:00
underfin
b199cb89a2
feat: add oxc sourcemap crate (#2825)
The sourcemap implement port from
[rust-sourcemap](https://github.com/getsentry/rust-sourcemap), but has
some different with it.

- Encode sourcemap at parallel, including quote `sourceContent` and
encode token to `vlq` mappings.
- Avoid `Sourcemap` some methods overhead, like `SourceMap::tokens()`
caused extra overhead at common cases. Here using `SourceViewToken` to
instead of it.
2024-03-28 19:36:38 +08:00
Dunqing
2c6bfa3dde
feat(linter/import) check type import in no_duplicates (#2777)
Grouping unmergeable imports to determine if they are duplicates
2024-03-28 17:13:25 +08:00
Dunqing
920d1be286
feat(linter/import) check module import in no_duplicates (#2771)
We should use `requested_modules` instead of `loaded_modules` because
`loaded_modules` only contains successfully resolved modules.
2024-03-28 15:25:10 +08:00
Dunqing
d63807e703
feat(linter): fallback to the default tsconfig path (#2842)
Users usually do not need to manually set the tsconfig path, as it is
usually located in cwd/tsconfig.json.
2024-03-28 15:23:12 +08:00
Dunqing
ab7d7dcbe8
feat(linter/import) support allow_computed option in namespace (#2840) 2024-03-28 14:49:39 +08:00
Dunqing
40f4c1fafd
feat(linter/import) check deep namespace in namespace rule (#2805) 2024-03-28 14:47:36 +08:00
Wang Wenzhe
0cae373672
feat(linter/tree-shaking): pass CallExpression cases (#2839) 2024-03-28 09:48:41 +08:00
Dunqing
ec05a41525
chore: update transformer snapshots (#2838) 2024-03-27 15:02:09 +08:00
Dunqing
d67100730b
feat(tasks/transforme_conformance): support for testing oxc's test cases (#2835)
Related to:
https://github.com/oxc-project/oxc/pull/2822#issuecomment-2021802212

Although `babel` has a lot of test cases, we still need to add edge
cases that `babel` doesn't have.

This PR will allow us to add out test cases to
`/root/oxc/tasks/transform_conformance/tests`. The directory structure
is consistent with `babel`

For example
```shell
# cd /root/oxc/tasks/transform_conformance/tests
- babel-transform-plugin–optional-catch-binding
   - test
       - fixtures
           - your tests # add test cases here
```
2024-03-27 14:14:15 +08:00
Dunqing
947a9f05e8
fix(semantic): missing SymbolFlags::Export when identifier used in ExportDefaultDeclaration (#2837) 2024-03-27 14:13:25 +08:00
Ali Rezvani
528744ca0a
fix(transformer): optional-catch-binding unused variable side effect (#2822)
Before this PR for this given case:

```javascript
const _unused = "It's a lie, They gonna use me:(";
try {
    throw 0;
} catch {
  console.log(_unused);
}
```

We would've generated this:

```javascript
const _unused = "It's a lie, They gonna use me:(";
try {
    throw 0;
} catch (_unused) {
  console.log(_unused);
}
```

This is incorrect, This PR aims to use the `CreateVars` trait in order
to ensure the variable uniqueness.

Now it would output this:

```javascript
const _unused = "It's a lie, They gonna use me:(";
try {
    throw 0;
} catch (_unused2) {
  console.log(_unused);
}
```
2024-03-27 13:53:02 +08:00
Ali Rezvani
b76b02d019
fix(parser): add support for empty module declaration (#2834)
Should be merged after #2829, Tried a few times to get it done with
graphite stacking but found no success. I guess it either doesn't work
with forks or It is just a skill issue since I'm not familiar with it.

closes: #2829
closes: #2830

---------

Co-authored-by: Dmytro Maretskyi <maretskii@gmail.com>
2024-03-27 13:48:03 +08:00