Commit graph

4623 commits

Author SHA1 Message Date
heygsc
0fba73897c
fix(npm): SyntaxError caused by optional chaining in low version node (#4650)
fix: #4602
2024-08-05 13:01:31 +08:00
renovate[bot]
649e7c30cf
chore(deps): update github-actions (#4652)
[![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 | minor | `v1.8.0` -> `v1.9.0` |
| [crate-ci/typos](https://togithub.com/crate-ci/typos) | action | patch
| `v1.23.5` -> `v1.23.6` |

---

### Release Notes

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

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

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

*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:

- Add `--maximum-resolution-timeout`
([#&#8203;1823](https://togithub.com/cargo-bins/cargo-binstall/issues/1823)
[#&#8203;1862](https://togithub.com/cargo-bins/cargo-binstall/issues/1862))
- Fix: `--strategies` on CLI do not seem to override disabled-strategies
in the manifest
([#&#8203;1851](https://togithub.com/cargo-bins/cargo-binstall/issues/1851)
[#&#8203;1857](https://togithub.com/cargo-bins/cargo-binstall/issues/1857))

</details>

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

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

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

#### \[1.23.6] - 2024-07-31

##### Fixes

- Updated the dictionary with the [July
2024](https://togithub.com/crate-ci/typos/issues/1051) changes

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 04:05:57 +00:00
Dunqing
48031ada93 fix(transformer/typescript) shadowed imports have not been removed (#4550)
close: #4423
2024-08-05 03:15:14 +00:00
Dunqing
4efd54b84d fix(transformer/typescript): incorrect SymbolFlags for jsx imports (#4549)
All `SymbolFlags` for imports should be `SymbolFlags::Import`
2024-08-05 03:15:13 +00:00
renovate[bot]
6058dfb214
chore(deps): update dependency @types/node to v22.1.0 (#4649)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node))
| [`22.0.0` ->
`22.1.0`](https://renovatebot.com/diffs/npm/@types%2fnode/22.0.0/22.1.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/22.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/22.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/22.0.0/22.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/22.0.0/22.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 03:12:42 +00:00
DonIsaac
b2da22b30f fix(linter): invalid tags in rule docs (#4646)
These are causing build errors in doc pages in PR #4640
2024-08-05 02:34:38 +00:00
overlookmotel
b8e67538f8 perf(codegen): u32 indexes in LineOffsetTable for source maps (#4641)
Oxc have a limit on size of source files of 4 GiB, so `u32` is sufficient to hold line and column offsets. Use `u32` for these values in `LineOffsetTable`, which reduces size of the type by 8 bytes.
2024-08-05 02:28:50 +00:00
leaysgur
6c612d141c fix(semantic/jsdoc): Handle whitespace absence (#4642)
Follow up for #4632
2024-08-05 02:25:13 +00:00
renovate[bot]
b8e2d9c7ac
chore(deps): update rust crates (#4645)
[![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.30` -> `1.0.31` |
| [indexmap](https://togithub.com/indexmap-rs/indexmap) |
workspace.dependencies | minor | `2.2.6` -> `2.3.0` |
| [regex](https://togithub.com/rust-lang/regex) | workspace.dependencies
| patch | `1.10.5` -> `1.10.6` |
| [serde_json](https://togithub.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.121` -> `1.0.122` |
| [tempfile](https://stebalien.com/projects/tempfile-rs/)
([source](https://togithub.com/Stebalien/tempfile)) |
workspace.dependencies | minor | `3.10.1` -> `3.11.0` |

---

### Release Notes

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

###
[`v2.3.0`](https://togithub.com/indexmap-rs/indexmap/blob/HEAD/RELEASES.md#230)

[Compare
Source](https://togithub.com/indexmap-rs/indexmap/compare/2.2.6...2.3.0)

- Added trait `MutableEntryKey` for opt-in mutable access to map entry
keys.
- Added method `MutableKeys::iter_mut2` for opt-in mutable iteration of
map
    keys and values.

</details>

<details>
<summary>rust-lang/regex (regex)</summary>

###
[`v1.10.6`](https://togithub.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#1106-2024-08-02)

[Compare
Source](https://togithub.com/rust-lang/regex/compare/1.10.5...1.10.6)

\===================
This is a new patch release with a fix for the `unstable` crate feature
that
enables `std::str::Pattern` trait integration.

Bug fixes:

-   [BUG #&#8203;1219](https://togithub.com/rust-lang/regex/pull/1219):
Fix the `Pattern` trait implementation as a result of nightly API
breakage.

</details>

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

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

[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.121...v1.0.122)

- Support using `json!` in no-std crates
([#&#8203;1166](https://togithub.com/serde-rs/json/issues/1166))

</details>

<details>
<summary>Stebalien/tempfile (tempfile)</summary>

###
[`v3.11.0`](https://togithub.com/Stebalien/tempfile/blob/HEAD/CHANGELOG.md#3110)

[Compare
Source](https://togithub.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

- Add the ability to override the default temporary directory. This API
shouldn't be used in general, but there are some cases where it's
unavoidable.

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 02:12:16 +00:00
overlookmotel
ff43dff99d perf(sourcemap): speed up VLQ encoding (#4633)
Speed up source map VLQ encoding by removing a couple of operations from `serialize_mappings`'s hot loop.

On a local benchmark of just VLQ encoding, this change produces 5% performance increase (benchmarked on MacBook Pro M1).
2024-08-05 01:34:59 +00:00
overlookmotel
a3307734c5 perf(sourcemap): reduce string copying in ConcatSourceMapBuilder (#4638)
Clone `Arc<str>`s for source text instead of creating new `Arc<str>`s and copying the string data.

For the shorter strings (names and source filenames) it's cheaper to create a new `Arc<str>` than to clone, presumably because of the overhead of atomic operations involved in `Arc::clone`.
2024-08-05 01:26:13 +00:00
overlookmotel
372316bf87 perf(sourcemap): ConcatSourceMapBuilder extend source_contents in separate loop (#4634)
Small optimization to source map concatenation. Check if input sourcemap has `source_contents` once, rather than on each turn of the loop.
2024-08-05 01:26:12 +00:00
rzvxa
0d2c41a2cb fix(semantic/jsdoc): panic on parsing type_name_comment. (#4632)
fixes #4627
2024-08-05 01:17:53 +00:00
rzvxa
94440ad35f fix(linter): panic on invalid lang in a11y/lang. (#4630)
fixes #4629
2024-08-05 01:15:39 +00:00
renovate[bot]
439ce5bc85
chore(deps): update dependency axios to v1.7.3 (#4637)
[![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.2` ->
`1.7.3`](https://renovatebot.com/diffs/npm/axios/1.7.2/1.7.3) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/axios/1.7.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/axios/1.7.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/axios/1.7.2/1.7.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/axios/1.7.2/1.7.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

###
[`v1.7.3`](https://togithub.com/axios/axios/blob/HEAD/CHANGELOG.md#173-2024-08-01)

[Compare
Source](https://togithub.com/axios/axios/compare/v1.7.2...v1.7.3)

##### Bug Fixes

- **adapter:** fix progress event emitting;
([#&#8203;6518](https://togithub.com/axios/axios/issues/6518))
([e3c76fc](e3c76fc9bd))
- **fetch:** fix withCredentials request config
([#&#8203;6505](https://togithub.com/axios/axios/issues/6505))
([85d4d0e](85d4d0ea0a))
- **xhr:** return original config on errors from XHR adapter
([#&#8203;6515](https://togithub.com/axios/axios/issues/6515))
([8966ee7](8966ee7ea6))

##### 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 "+211/-159 (#&#8203;6518
#&#8203;6519 )")
- <img
src="https://avatars.githubusercontent.com/u/10867286?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [Valerii
Sidorenko](https://togithub.com/ValeraS "+3/-3 (#&#8203;6515 )")
- <img
src="https://avatars.githubusercontent.com/u/8599535?v&#x3D;4&amp;s&#x3D;18"
alt="avatar" width="18"/> [prianYu](https://togithub.com/prianyu "+2/-2
(#&#8203;6505 )")

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 00:05:57 +00:00
renovate[bot]
819e0b1d09
chore(deps): update dependency @codemirror/view to v6.29.1 (#4636)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@codemirror/view](https://togithub.com/codemirror/view) | [`6.29.0`
->
`6.29.1`](https://renovatebot.com/diffs/npm/@codemirror%2fview/6.29.0/6.29.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@codemirror%2fview/6.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@codemirror%2fview/6.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@codemirror%2fview/6.29.0/6.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@codemirror%2fview/6.29.0/6.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>codemirror/view (@&#8203;codemirror/view)</summary>

###
[`v6.29.1`](https://togithub.com/codemirror/view/blob/HEAD/CHANGELOG.md#6291-2024-07-29)

[Compare
Source](https://togithub.com/codemirror/view/compare/6.29.0...6.29.1)

##### Bug fixes

Fix a crash on old Safari browsers that don't support
`MediaQueryList.addEventListener`.

Fix an issue where `EditorView.viewportLineBlocks` (and thus other
things like the gutter) might be out of date after some kinds of
decoration changes.

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-05 00:02:20 +00:00
Alexander S.
c296bc34bc
feat(linter/eslint): implement func-names (#4618) 2024-08-04 19:41:57 -04:00
Boshen
e78cba6464 refactor(minifier): ast passes infrastructure (#4625)
After studying google closure compiler, I'm leaning towards a multi-ast-pass infrastructure for the minifier.

This is one of the few places where we are going to trade maintainability over performance, given the goal of the minifier is compression size not performance.

All of the terminologies and separation of concerns are aligned with google closure compiler.

Infrastructure of `terser` and `esbuild` are not suitable for us to study nor pursuit. Their code are so tightly coupled - I failed to comprehend any of them every time I try to walk through a piece of optmization. Google closure compiler despite being written in Java, it's actually the most readable minifier out there.

To improve performance between ast passes, I envision a change detection system over a portion of the code.

The benchmark will demonstrate the performance regression of running 5 ast passes instead of 2.

To complete this PR, I need to figure out "fix-point" and order of these ast passes.
2024-08-04 11:58:39 +00:00
Dunqing
3a6e4d91cf feat(transformer_conformance): test ScopeTree and SymbolTable for correctness after transformation (#4581)
part of #4549

This test verifies that the correct symbols and scopes were added/changed during the transformation. From the snapshots, most of them are incorrect currently
2024-08-04 11:45:10 +00:00
Boshen
73d2558c14
fix(oxlint): fix oxlint failed to build due to missing feature
closes #4626
2024-08-04 19:33:04 +08:00
Rintaro Itokawa
c69ada4809
docs(ast): improve AST node documentation (#4051)
partof #2803 

I even wrote a VariableDeclaration.
2024-08-04 17:38:54 +08:00
Yuji Sugiura
a6647153be
fix(linter/eslint): Fix invalid regexp in no_regex_spaces test (#4605)
The same as #4544 


![image](https://github.com/user-attachments/assets/79624f6f-f49c-4aa3-bae6-0a4efda0d692)
2024-08-04 15:07:53 +08:00
Boshen
a40a217de4 fix(parser): parse assert keyword in TSImportAttributes (#4610)
closes #4601
2024-08-04 01:41:31 +00:00
DonIsaac
6ff200d072 perf(linter): change react rules and utils to use Cow and CompactStr instead of String (#4603) 2024-08-03 21:26:08 +00:00
DonIsaac
fd2d9dafcd feat(ast): improve AstKind::debug_name (#4553)
> Part of #4445

Improve `debug_name` to show identifier names for more AST kinds.
2024-08-03 21:22:05 +00:00
DonIsaac
b3b70282c7 feat(ast): implement missing Clone, Hash, and Display traits for literals (#4552) 2024-08-03 17:07:03 +00:00
rzvxa
ba7000107e refactor(ast): put assert_layouts.rs behind debug_assertions (#4621)
#4615 was showing as green on all checks, but failed CI on main once merged because of errors in "Test wasm32-wasip1-threads" job, which only runs on main. This change will make sure any such problem gets caught at the PR stage in future.
2024-08-03 15:25:02 +00:00
rzvxa
61e8b8c6c5 chore: make test-wasm32-unknown-unknown run unconditionally. (#4624)
It used to be unconditional before #4547, Having it to run all PRs allows us to run `oxc_ast::generated::assert_layouts` tests on 32-bit platforms.
2024-08-03 15:25:02 +00:00
rzvxa
49d5196e57 test(ast): fix assert_layouts.rs offset tests on 32bit platforms. (#4620) 2024-08-03 14:37:30 +00:00
rzvxa
297401db42 chore: fix mistake in configuring deny.toml V2 (#4619)
Follow up to #4616, Fixing my mistake.
2024-08-03 13:03:05 +00:00
rzvxa
0c52c0db02 feat(ast_codegen): add alignment and size data to the schema. (#4615)
This PR generates the layouts in the schema but doesn't use it to reorder.
2024-08-03 12:43:10 +00:00
rzvxa
3f53b6f586 refactor(ast): make AST structs repr(C). (#4614)
Make structs `#[repr(C)]` without reordering them to benchmark the performance implications of it.

This PR adds 136 bytes of padding in total. You can visit the list of these types [here](https://github.com/oxc-project/oxc/pull/4404/files/)(checkout the `assert_layouts.rs` diff).

Update:

Doesn't seem too bad!

![image](https://github.com/user-attachments/assets/05ac9cc8-7cb0-4ed5-9220-44f65c7f5bb9)

* Linter: We can easily get more than 1% performance gain in the linter to even things out
* Prepass: If we fix our issue with Rust `1.80.0` we gain 13% And it should also be possible to find some other areas there to gain back this one percent.

The most notable thing is that `parser` isn't impacted by this, That is our most optimized crate which every percent counts(and it can be hard to gain back any perf regression there).
2024-08-03 12:23:41 +00:00
rzvxa
bcfa2978e7 fix(ast_codegen): detect "complex" type wrappers (#4617)
Detect types such as `Cell<Option<ScopeId>>` and mark them as such! We didn't used to use this method for these options but now we have to check all types to calculate their layouts which means we need to process them correctly(instead of falling to their inner value).
2024-08-03 12:11:34 +00:00
Jelle van der Waa
e2b15ac920
feat(linter/react): implement react-jsx-boolean-value (#4613)
Rule Detail:

[link](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md)
2024-08-03 13:36:42 +08:00
rzvxa
d25dea7b94 refactor(parser): use ast_builder in more places. (#4612) 2024-08-02 22:38:06 +00:00
rzvxa
84d80c124f
chore: update deny.toml to version 2. (#4616)
Fixes the errors raised
[here](https://github.com/oxc-project/oxc/actions/runs/10218564260/job/28274959011?pr=4404).

Based on https://github.com/EmbarkStudios/cargo-deny/pull/611 and the
latest version of
[docs](https://embarkstudios.github.io/cargo-deny/checks/index.html).
2024-08-03 08:10:11 +10:00
overlookmotel
54047e021c feat(ast): GetSpanMut trait (#4609)
Closes #4606.

Introduce `GetSpanMut` trait and implement it on all AST node types.

This has to be a separate trait, rather than adding `span_mut` method to `GetSpan` because `AstKind` implements `GetSpan`, and it only has an immutable `&` ref to AST node it contains.
2024-08-02 11:50:24 +00:00
DonIsaac
f259df0d62 perf(linter): make img-redundant-alt only build a regex once (#4604) 2024-08-02 11:35:52 +00:00
Jelle van der Waa
74fa75aa87
fix(linter/eslint): drop quotes around max-params lint warning (#4608)
This was introduced by the diagnostic codes in lint rules 7a75e0f8a7.

---

Checked the rest of the codebase and haven't found other issues.
2024-08-02 17:36:08 +08:00
rzvxa
f39e759a53 refactor(ast_codegen): abstract passes and generators behind Runner trait. (#4556) 2024-08-02 00:08:05 +00:00
rzvxa
abc88363d7 fix(ast_codegen): create output path if doesn't exist. (#4555) 2024-08-02 00:08:02 +00:00
rzvxa
65c411eea1 feat(ast_codegen): add normalize_with to create errors from options. (#4554) 2024-08-02 00:07:59 +00:00
rzvxa
e736a5478c refactor(ast_codegen): cleanup schema generated by ast_codegen. (#4403) 2024-08-02 00:07:56 +00:00
rzvxa
26c6e80354 refactor(ast_codegen): cleanup ast_codegen. (#4392) 2024-08-02 00:07:53 +00:00
rzvxa
8685932c0b refactor(ast_codegen): use stringify for generators names. (#4388)
The generator name is always the same as its identifier so this PR changes all `"<generator_ident>"` to `stringify!(<generator_ident>)`
2024-08-02 00:07:50 +00:00
rzvxa
eae401c90b feat(ast, ast_macros): apply stable repr to all #[ast] enums (#4373)
closes #4296
2024-08-02 00:07:46 +00:00
overlookmotel
452e0eebb4 refactor(ast): remove defunct visit_as + visit_args attrs from #[ast] macro (#4599)
#4371 replaced `#[visit_as(...)]` and `#[visit_args(...)]` with `#[visit(as(...))]` and `#[visit(args(...))]`. Remove these defunct helper attributes from the `#[ast]` macro.
2024-08-01 22:48:03 +00:00
heygsc
e0b03f85d6
fix(linter): improve the boundary for eslint/for-direction (#4590)
is_sign_positive() will treat 0.0 as true, which may cause some errors.

https://eslint.org/docs/latest/rules/for-direction#rule-details

demo

[oxc](https://oxc-project.github.io/oxc/playground/?code=3YCAAICfgICAgICAgICzm0omL6Rfsn9X7Kj61BmzN0yVAOAXkgdgAKNr9vvkaX9%2FKzKAgA%3D%3D)

[eslint](https://eslint.org/play/#eyJ0ZXh0IjoiZm9yKGxldCBpID0gMDsgaSA8IDEwOyBpLT0wKXtcbn0iLCJvcHRpb25zIjp7InJ1bGVzIjp7ImZvci1kaXJlY3Rpb24iOlsiZXJyb3IiXX0sImxhbmd1YWdlT3B0aW9ucyI6eyJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6e319fX19)

---------

Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-08-01 11:40:16 -04:00
overlookmotel
c7f1d48c0e perf(sourcemap): keep local copy of previous token in VLQ encode (#4596)
In source map VLQ encoding, keep local copy of previous `Token`, rather than looking up up from `tokens`.

On a local benchmark of just VLQ encoding, this change produces 6% performance increase (benchmarked on MacBook Pro M1).
2024-08-01 14:58:08 +00:00
DonIsaac
70b8cfaa53 fix(linter): missing return in no-obj-calls recursion (#4594) 2024-08-01 12:25:24 +00:00