Commit graph

5097 commits

Author SHA1 Message Date
Boshen
293668bebd
chore(tasks): parse regular expression in parser benchmark (#5212) 2024-08-26 13:11:09 +08:00
Kevin Deng 三咲智子
1cd5401ad7
fix(wasm): respect camelCase (#5213) 2024-08-26 12:51:19 +08:00
dalaoshu
0d3661a23c
refactor(linter): remove meaningless span0 (#5209)
Yes. Those were added due to a code mod. the number suffixes were to
avoid name collisions.

_Originally posted by @DonIsaac in
https://github.com/oxc-project/oxc/pull/5203#discussion_r1730578314_
2024-08-26 12:29:45 +08:00
Dunqing
293413fe71 fix(semantic): implicit return UpdateExpression in ArrowFunctionExpression does not as read reference (#5161)
close: #5158
close: #5156
2024-08-26 03:30:16 +00:00
renovate[bot]
04c5ca2ceb
chore(deps): update rust crates (#5208)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [flate2](https://togithub.com/rust-lang/flate2-rs) |
workspace.dependencies | patch | `1.0.31` -> `1.0.33` |
| [prettyplease](https://togithub.com/dtolnay/prettyplease) |
workspace.dependencies | patch | `0.2.20` -> `0.2.22` |
| [quote](https://togithub.com/dtolnay/quote) | workspace.dependencies |
patch | `1.0.36` -> `1.0.37` |
| [serde](https://serde.rs)
([source](https://togithub.com/serde-rs/serde)) | workspace.dependencies
| patch | `1.0.208` -> `1.0.209` |
| [serde_json](https://togithub.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.125` -> `1.0.127` |

---

### Release Notes

<details>
<summary>rust-lang/flate2-rs (flate2)</summary>

###
[`v1.0.33`](https://togithub.com/rust-lang/flate2-rs/releases/tag/1.0.33):
- fix minimal manifest versions

[Compare
Source](https://togithub.com/rust-lang/flate2-rs/compare/1.0.32...1.0.33)

#### What's Changed

- Fix msrv: Run msrv checks with minimal versions by
[@&#8203;NobodyXu](https://togithub.com/NobodyXu) in
[https://github.com/rust-lang/flate2-rs/pull/425](https://togithub.com/rust-lang/flate2-rs/pull/425)

#### New Contributors

- [@&#8203;NobodyXu](https://togithub.com/NobodyXu) made their first
contribution in
[https://github.com/rust-lang/flate2-rs/pull/425](https://togithub.com/rust-lang/flate2-rs/pull/425)

**Full Changelog**:
https://github.com/rust-lang/flate2-rs/compare/1.0.32...1.0.33

###
[`v1.0.32`](https://togithub.com/rust-lang/flate2-rs/releases/tag/1.0.32):
- turn panic into error

[Compare
Source](https://togithub.com/rust-lang/flate2-rs/compare/1.0.31...1.0.32)

#### What's Changed

##### Fix

- Return error instead of packing on Z_MEM_ERROR by
[@&#8203;crazymerlyn](https://togithub.com/crazymerlyn) in
[https://github.com/rust-lang/flate2-rs/pull/423](https://togithub.com/rust-lang/flate2-rs/pull/423)

##### Other

- prepare new release by [@&#8203;Byron](https://togithub.com/Byron) in
[https://github.com/rust-lang/flate2-rs/pull/416](https://togithub.com/rust-lang/flate2-rs/pull/416)
- update miniz_oxide dependency to 0.8.x by
[@&#8203;oyvindln](https://togithub.com/oyvindln) in
[https://github.com/rust-lang/flate2-rs/pull/420](https://togithub.com/rust-lang/flate2-rs/pull/420)
- update maintenance guide with recent news by
[@&#8203;Byron](https://togithub.com/Byron) in
[https://github.com/rust-lang/flate2-rs/pull/419](https://togithub.com/rust-lang/flate2-rs/pull/419)
- Check minimal version of Rust that compiles by
[@&#8203;jongiddy](https://togithub.com/jongiddy) in
[https://github.com/rust-lang/flate2-rs/pull/421](https://togithub.com/rust-lang/flate2-rs/pull/421)
- Remove non-existent build in CI by
[@&#8203;jongiddy](https://togithub.com/jongiddy) in
[https://github.com/rust-lang/flate2-rs/pull/422](https://togithub.com/rust-lang/flate2-rs/pull/422)

#### New Contributors

- [@&#8203;crazymerlyn](https://togithub.com/crazymerlyn) made their
first contribution in
[https://github.com/rust-lang/flate2-rs/pull/423](https://togithub.com/rust-lang/flate2-rs/pull/423)

**Full Changelog**:
https://github.com/rust-lang/flate2-rs/compare/1.0.31...1.0.32

</details>

<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>

###
[`v0.2.22`](https://togithub.com/dtolnay/prettyplease/releases/tag/0.2.22)

[Compare
Source](https://togithub.com/dtolnay/prettyplease/compare/0.2.21...0.2.22)

- Support formatting precise capture `use<>` syntax
([#&#8203;80](https://togithub.com/dtolnay/prettyplease/issues/80))

###
[`v0.2.21`](https://togithub.com/dtolnay/prettyplease/releases/tag/0.2.21)

[Compare
Source](https://togithub.com/dtolnay/prettyplease/compare/0.2.20...0.2.21)

- Support formatting tail-call `become` expressions
([#&#8203;79](https://togithub.com/dtolnay/prettyplease/issues/79))

</details>

<details>
<summary>dtolnay/quote (quote)</summary>

### [`v1.0.37`](https://togithub.com/dtolnay/quote/releases/tag/1.0.37)

[Compare
Source](https://togithub.com/dtolnay/quote/compare/1.0.36...1.0.37)

- Implement ToTokens for CStr and CString
([#&#8203;283](https://togithub.com/dtolnay/quote/issues/283))

</details>

<details>
<summary>serde-rs/serde (serde)</summary>

###
[`v1.0.209`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.209)

[Compare
Source](https://togithub.com/serde-rs/serde/compare/v1.0.208...v1.0.209)

- Fix deserialization of empty structs and empty tuples inside of
untagged enums
([#&#8203;2805](https://togithub.com/serde-rs/serde/issues/2805), thanks
[@&#8203;Mingun](https://togithub.com/Mingun))

</details>

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.127`](https://togithub.com/serde-rs/json/releases/tag/1.0.127)

[Compare
Source](https://togithub.com/serde-rs/json/compare/1.0.126...1.0.127)

- Add more removal methods to OccupiedEntry
([#&#8203;1179](https://togithub.com/serde-rs/json/issues/1179), thanks
[@&#8203;GREsau](https://togithub.com/GREsau))

###
[`v1.0.126`](https://togithub.com/serde-rs/json/releases/tag/1.0.126)

[Compare
Source](https://togithub.com/serde-rs/json/compare/1.0.125...1.0.126)

- Improve string parsing on targets that use 32-bit pointers but also
have fast 64-bit integer arithmetic, such as
aarch64-unknown-linux-gnu_ilp32 and x86\_64-unknown-linux-gnux32
([#&#8203;1182](https://togithub.com/serde-rs/json/issues/1182), thanks
[@&#8203;CryZe](https://togithub.com/CryZe))

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

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

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-26 03:19:54 +00:00
dalaoshu
004ffa082c
feat(linter/vitest): implement prefer-each (#5203)
Related to #4656

---------

Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-08-25 23:00:13 -04:00
dalaoshu
ce454cf426
perf: use simdutf8 to validate UTF-8 when reading files (#5196)
closes #5191

---------

Co-authored-by: overlookmotel <j@dummett.org>
2024-08-26 10:14:21 +08:00
Boshen
fb847bd0ba perf(codegen): slightly faster print_list (#5192) 2024-08-26 01:37:48 +00:00
renovate[bot]
e51a1027c2
chore(deps): update github-actions (#5207)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[cargo-bins/cargo-binstall](https://togithub.com/cargo-bins/cargo-binstall)
| action | patch | `v1.10.2` -> `v1.10.3` |
| [crate-ci/typos](https://togithub.com/crate-ci/typos) | action | minor
| `v1.23.6` -> `v1.24.1` |

---

### Release Notes

<details>
<summary>cargo-bins/cargo-binstall (cargo-bins/cargo-binstall)</summary>

###
[`v1.10.3`](https://togithub.com/cargo-bins/cargo-binstall/releases/tag/v1.10.3)

[Compare
Source](https://togithub.com/cargo-bins/cargo-binstall/compare/v1.10.2...v1.10.3)

*Binstall is a tool to fetch and install Rust-based executables as
binaries. It aims to be a drop-in replacement for `cargo install` in
most cases. Install it today with `cargo install cargo-binstall`, from
the binaries below, or if you already have it, upgrade with `cargo
binstall cargo-binstall`.*

##### In this release:

-   Upgrade dependencies

</details>

<details>
<summary>crate-ci/typos (crate-ci/typos)</summary>

###
[`v1.24.1`](https://togithub.com/crate-ci/typos/releases/tag/v1.24.1)

[Compare
Source](https://togithub.com/crate-ci/typos/compare/v1.24.0...v1.24.1)

#### \[1.24.1] - 2024-08-23

##### Fixes

-   Remove unverified varcon (locale data) entries

###
[`v1.24.0`](https://togithub.com/crate-ci/typos/releases/tag/v1.24.0)

[Compare
Source](https://togithub.com/crate-ci/typos/compare/v1.23.7...v1.24.0)

#### \[1.24.0] - 2024-08-23

##### Features

-   Update varcon (locale data) to version 2020.12.07

###
[`v1.23.7`](https://togithub.com/crate-ci/typos/releases/tag/v1.23.7)

[Compare
Source](https://togithub.com/crate-ci/typos/compare/v1.23.6...v1.23.7)

#### \[1.23.7] - 2024-08-22

##### Fixes

- *(config)* Respect `--locale` / `default.locale` again after it was
broken in 1.16.24

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

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

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-26 00:06:17 +00:00
overlookmotel
2a91ef10ea refactor(linter): eslint/no_redeclare rule use run_on_symbol not run_once (#5201)
`eslint/no_redeclare` rule iterates over all symbols. Use `run_on_symbols` for this, instead of `run_once`.
2024-08-25 21:40:58 +00:00
DonIsaac
8ff6f2cb86 fix(linter/no-unused-vars): panic on UsingDeclarations (#5206)
Closes #5202
2024-08-25 21:26:45 +00:00
camc314
982bd6ecb7 feat(linter/unicorn): add fixer to require-array-join-separator (#5152) 2024-08-25 21:07:17 +00:00
camc314
a6704bd293 feat(linter/unicorn): add fixer to prefer-set-size (#5149) 2024-08-25 21:04:10 +00:00
renovate[bot]
67c7802a58
chore(deps): update dependency axios to v1.7.5 (#5205)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

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

---

### Release Notes

<details>
<summary>axios/axios (axios)</summary>

###
[`v1.7.5`](https://togithub.com/axios/axios/blob/HEAD/CHANGELOG.md#175-2024-08-23)

[Compare
Source](https://togithub.com/axios/axios/compare/v1.7.4...v1.7.5)

##### Bug Fixes

- **adapter:** fix undefined reference to hasBrowserEnv
([#&#8203;6572](https://togithub.com/axios/axios/issues/6572))
([7004707](7004707c41))
- **core:** add the missed implementation of AxiosError#status property;
([#&#8203;6573](https://togithub.com/axios/axios/issues/6573))
([6700a8a](6700a8adac))
- **core:** fix `ReferenceError: navigator is not defined` for custom
environments;
([#&#8203;6567](https://togithub.com/axios/axios/issues/6567))
([fed1a4b](fed1a4b2d7))
- **fetch:** fix credentials handling in Cloudflare workers
([#&#8203;6533](https://togithub.com/axios/axios/issues/6533))
([550d885](550d885eb9))

##### Contributors to this release

- <img
src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Dmitriy
Mozgovoy](https://togithub.com/DigitalBrainJS "+187/-83 (#&#8203;6573
#&#8203;6567 #&#8203;6566 #&#8203;6564 #&#8203;6563 #&#8203;6557
#&#8203;6556 #&#8203;6555 #&#8203;6554 #&#8203;6552 )")
- <img
src="https://avatars.githubusercontent.com/u/2495809?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Antonin Bas](https://togithub.com/antoninbas
"+6/-6 (#&#8203;6572 )")
- <img
src="https://avatars.githubusercontent.com/u/5406212?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Hans Otto
Wirtz](https://togithub.com/hansottowirtz "+4/-1 (#&#8203;6533 )")

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **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 was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-25 18:55:22 +00:00
dalaoshu
aaaf26cee4
fix(linter): error in fixer for prefer-to-have-length (#5197)
closes #5195
2024-08-25 17:13:56 +01:00
overlookmotel
f3e1662e4e improve(codegen): improve oxc_codegen example (#5198)
Improve `oxc_codegen` example to demonstrate best practice of resetting the allocator once the AST stored in it is no longer needed, before parsing another file.
2024-08-25 14:58:27 +00:00
Kevin Deng 三咲智子
8ebc23f84c
fix(ast): serialize TSParenthesizedType with camelCase (#5199) 2024-08-25 22:58:04 +08:00
Kevin Deng 三咲智子
bf49f339d0
chore: pin pnpm version & upgrade lockfile version (#5200) 2024-08-25 22:57:33 +08:00
camc314
ac7edccab3 feat(linter/unicorn): add fixer to prefer-array-some (#5153) 2024-08-25 13:25:12 +00:00
Dunqing
f8bb0222b3 fix(transformer/arrow-functions): remove SymbolFlags::ArrowFunction (#5190)
`ArrowFunction` has been transforming to `FunctionExpression`, So we should remove `SymbolFlags::ArrowFunction`
2024-08-25 10:27:00 +00:00
Dunqing
d9ba5ad022 fix(transformer/arrow-functions): correct scope for _this (#5189)
The `_this` will eventually be inserted into a `Program` or `Function`. So we have to go up to the corresponding `scope_id`
2024-08-25 10:26:59 +00:00
Dunqing
056c6679ec feat(transformer/arrow-functions): the output that uses this inside blocks doesn't match Babel (#5188)
Fixes 666282a13b/crates/oxc_transformer/src/es2015/arrow_functions.rs (L35-L62)
2024-08-25 10:26:57 +00:00
Dunqing
260c9d2712 refactor(transformer/es2015): move all entry points to implementation of Traverse trait (#5187) 2024-08-25 10:26:56 +00:00
Dunqing
d51a9549f7 docs(transformer): add documentation for arrow-functions plugin (#5186) 2024-08-25 10:26:54 +00:00
Kevin Deng 三咲智子
d22bd2082a
feat(module_lexer): distinguish for types-only imports and exports (#5184)
Co-authored-by: Boshen <boshenc@gmail.com>
2024-08-25 18:22:44 +08:00
overlookmotel
666282a13b refactor(ci): remove extraneous doc comment (#5185)
Replace doc comment with plain comment.
2024-08-25 07:39:38 +00:00
Boshen
543cad6370
refactor(codegen): remove some pub APIs 2024-08-25 13:32:55 +08:00
dalaoshu
72740b3f78
feat(isolated_declaration): support sourcemap option (#5170)
closes #4313
2024-08-25 13:32:47 +08:00
Boshen
1e8d3dde3b
chore: update .github/codecov.yml 2024-08-25 11:57:28 +08:00
DonIsaac
a877e5a612 test(linter/no-unused-vars): ensure type annotations on property accessors are considered used (#5183) 2024-08-25 01:02:51 +00:00
DonIsaac
49cd5db54f feat(ast,parser): add definite flag to AccessorProperty node (#5182) 2024-08-25 01:02:50 +00:00
DonIsaac
7dfd51a62b feat(parser): report class properties that are both definite and optional (#5181) 2024-08-25 01:02:49 +00:00
DonIsaac
a563968386 feat(parser): report errors on optional accessor properties (#5180) 2024-08-25 01:02:49 +00:00
DonIsaac
c2fa72571f feat(ast,parser): parse TSTypeAnnotations on AccessorProperty (#5179)
Closes #5177

While making this, I noticed an uncaught parse error for accessors: accessors cannot be optional. I'll add a fix for this in an up-stack PR.
2024-08-25 01:02:48 +00:00
camc314
1d01aa316f feat(linter/unicorn): add partial fixer for prefer-array-flat (#5143) 2024-08-24 22:58:38 +00:00
DonIsaac
fd1031abeb fix(linter/unicorn): breaking fixer in case statements for no-null (#5176) 2024-08-24 22:24:10 +00:00
Don Isaac
7b86ed61d1
fix(linter/unicorn): handle type casts and parens in no-null (#5175) 2024-08-24 18:18:52 -04:00
DonIsaac
7ab615220d refactor(linter/unicorn): clean up no-null (#5174) 2024-08-24 21:48:35 +00:00
DonIsaac
7886618e00 test(linter/unicorn): add fixer tests for no-null (#5173) 2024-08-24 21:48:34 +00:00
DonIsaac
b629e160db fix(linter/unicorn): improve diagnostic message for no-null (#5172)
This stack was made because of shortcomings I noticed while running `oxlint-eccosystem-ci` tests locally
2024-08-24 21:40:00 +00:00
camc314
dc9e1e233a fix(unicorn/linter) fix multiple false positives in no-useless-promise-resolve-reject (#5178)
more closely follows the implementation from unicorn's repo.

early returns if the parent is not a `return`, `yield`, or an arroy function

Closes #5125
Closes #5126
2024-08-24 21:03:31 +00:00
DonIsaac
d29042e7fc fix(linter/no-unused-vars): function expression in implicit arrow function return (#5155)
Fixes cases such as:
```ts
export const foo = () => function bar() {}
```
2024-08-24 15:49:56 +00:00
Cameron
147b37176b
fix(linter) fix bug in fixer for func names when function is async (#5167) 2024-08-24 11:30:56 -04:00
dalaoshu
1f5b6b6c82
fix(linter): bug in fixer for prefer-to-have-length (#5164) 2024-08-24 11:29:45 -04:00
Boshen
01c0c3e4b2 feat(transformer): add remaining options to transformer options (#5169)
closes #5168
2024-08-24 14:52:03 +00:00
Earl Chase
ba62a71975
fix(linter/react): Fixed false positive with missing key inside React.Children.toArray() for fragments (#5133)
Related: #4421 and #4945
2024-08-24 16:01:50 +08:00
Boshen
c96609151e
fix(coverage): fix cases where source_type is incorrectly set to script 2024-08-24 14:40:05 +08:00
Boshen
e4ca3d3901
chore(coverage): ignore annex-b/disabled tests 2024-08-24 14:20:06 +08:00
Boshen
12c21b2bfd
fix(coverage): do not run generated test cases when filter is applied 2024-08-24 14:03:54 +08:00
Boshen
7b1546bb66
fix(codegen): do not print comments when --minify 2024-08-24 13:49:34 +08:00