Commit graph

2606 commits

Author SHA1 Message Date
Boshen
0ae28dd159
feat(npm/oxlint): display target triple when error is thrown (#2259)
To improve debuggability

closes #2196
2024-02-02 11:22:34 +08:00
Boshen
a3df55e7ed
ci: unify the usage of concurrency.group
github.ref refers to the branch
2024-02-02 11:20:44 +08:00
hjio
a95a16c2ae
feat(linter): complete custom components setting (#2234)
- add custom components setting
- let tasks/rulegen generate settings

---------

Co-authored-by: huangjunjie.coder <huangjunjie.coder@bytedance.com>
2024-02-01 23:28:11 +08:00
Dunqing
de6d2f5dc5
refactor(transformer/decorators): optimizing code with ast.private_field (#2249) 2024-02-01 22:30:48 +08:00
Tzvi Melamed
f4674f33b2
fix(oxc_semantic): Handle short-circuiting operators in CFG (#2252)
Closes #2239
2024-02-01 21:04:28 +08:00
Tzvi Melamed
27681951e1
feat(oxc_semantic): Improve sample visualization (#2251)
1. add a `test.js` file to the project root:

```js
class A extends B {
  constructor() {
    try {
      super();
    } finally {
      this.a;
    }
  }
}
```

2. run:

```bash
$ cargo run -p oxc_semantic --example simple
   Compiling oxc_semantic v0.5.0 (/home/tzvipm/src/github.com/tzvipm/oxc/crates/oxc_semantic)
    Finished dev [unoptimized + debuginfo] target(s) in 32.07s
     Running `target/debug/examples/simple`
Wrote AST to: test.ast.txt
Wrote CFG blocks to: test.cfg.txt
Wrote CFG dot diagram to: test.dot
```

3. resulting graph from .dot file:


![image](https://github.com/TzviPM/oxc/assets/1950680/7163deaa-ab75-4bed-a093-946e2d6d2206)
2024-02-01 12:55:56 +00:00
Tzvi Melamed
73ccf8a4da
fix(oxc_semantic): proper traversal of try statements (#2250)
Closes #2227
2024-02-01 20:46:38 +08:00
Dunqing
165f948227
feat(ast): remove expression property from Function (#2247) 2024-02-01 15:23:27 +08:00
Dunqing
02c18d8506
feat(transformer/decorators): support for static and private member decorators (#2246) 2024-02-01 15:19:14 +08:00
Boshen
2beacd3f4d
fix(lexer): correct the span for irregular whitespaces (#2245)
closes #2236
2024-02-01 14:18:47 +08:00
Boshen
589fd0cdd1
chore: omit warning for unused TS_APPEND_CONTENT 2024-02-01 14:07:40 +08:00
Boshen
c0bdd050ee
ci: s/macos-latest/macos-14 (#2244) 2024-02-01 13:30:49 +08:00
Tzvi Melamed
e561457683
feat(semantic): track cfg index per ast node (#2210)
This allows looking up a cfg index from an ast node in a semantics
return. This allows later passes to better make use of the cfg.
2024-02-01 13:27:20 +08:00
Maurice Nicholson
6b2150f3b3
Better report source line and col for multiline annotations (#2242)
Improves diagnostic report source line- and column-number for
**multiline annotations**

Requires #2241
2024-02-01 11:37:28 +08:00
Dunqing
ba85b097e0
feat(transformer/decorators): support method decorator and is not static (#2238) 2024-02-01 11:36:22 +08:00
overlookmotel
d0d708295b
refactor(parser): consume chars when parsing surrogate pair escape (#2243)
This fixes a mistake I made in #2237.

I was confused by the `!(...)` wrapping of the preceding `if` test and
missed that there are definitely 2 chars to consume, so can use
`consume_char()` instead of `next_char()`. This makes no difference to
behavior, but it follows the convention to always prefer
`consume_char()` when possible.

I've also refactored the code which confused me, so hopefully others
won't be confused too!
2024-02-01 11:34:26 +08:00
Maurice Nicholson
9bbdec146f
Use oxc's own graphical reporter for test snapshots (#2241)
Fixes #2217

Previously we were using the miette default, but given ours is a fork,
and for example now prints slightly more relevant line- and
column-numbers vs miette, we should dog-food our own have the tests tell
us if/when the output changes.

I did actually scan all the snapshot deltas and all look correct to me.

One funny one I noticed was this

```diff
diff --git a/crates/oxc_linter/src/snapshots/no_empty_file.snap b/crates/oxc_linter/src/snapshots/no_empty_file.snap
index cfc53e1c..6f001fbd 100644
--- a/crates/oxc_linter/src/snapshots/no_empty_file.snap
+++ b/crates/oxc_linter/src/snapshots/no_empty_file.snap
@@ -2,6 +2,7 @@
 source: crates/oxc_linter/src/tester.rs
 expression: no_empty_file
 ---
+
   ⚠ eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
    ╭─[no_empty_file.tsx:1:1]
    ╰────
@@ -29,7 +30,7 @@ expression: no_empty_file
   help: Delete this file or add some code to it.
 
   ⚠ eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
-   ╭─[no_empty_file.tsx:1:1]
+   ╭─[no_empty_file.tsx:0:1]
  0 │ 
    · ▲
    ╰────
@@ -149,4 +150,3 @@ expression: no_empty_file
    ╰────
   help: Delete this file or add some code to it.
 
-
```

...which I suppose is technically correct but also a bit confusing
perhaps? Should we make the line **minimum 1**? If so I can create
another PR for that.

There is a subtle change in whitespace too - each file gains a newline
at the start but looses one at the end. My assumption is that oxc's
reporter is adding a newline at the start of each report (compared to
miette's), plus I removed the extra newline in `tester.rs` or else the
snapshot diffs would have been even larger.

Finally there are no changes to reports with *multi-line* annotations
like this:

```
  ⚠ typescript-eslint(ban-types): Prefer explicitly define the object shape
   ╭─[ban_types.tsx:1:1]
 1 │ ╭─▶ const emptyObj: {
 2 │ │   
 3 │ ╰─▶         } = {foo: "bar"};
   ╰────
  help: This type means "any non-nullish value", which is slightly better than 'unknown', but it's still a broad type
```

Again I can create a separate PR to improve those and we should see
snapshot diffs when I make that change 😄

I'd appreciate a quick review on this one if at all possible, given the
high chance of conflict.
2024-02-01 11:24:00 +08:00
overlookmotel
622a2c37fa
refactor(lexer): don't use lexer.current.chars directly (#2237)
This PR replaces most usages of `lexer.current.chars.next()` with
`lexer.consume_char()`, or a new function `lexer.next_char()`.

This is a preparatory step towards replacing the `Chars` iterator with
something more flexible which can also consume bytes (not `char`s), and
this PR was intended as pure refactor. But surprised to see there is a
small performance bump (no idea why!).

There's an additional benefit: Using `consume_char()` everywhere where
we believe there's definitely a char there to be consumed will make
logic errors produce a panic, rather than silently outputting garbage.
2024-01-31 21:35:46 +08:00
Dunqing
a79988d5e2
feat(transformer/decorators): support static member (#2235) 2024-01-31 19:11:27 +08:00
Dunqing
3b85e1813b
feat(transformer/decorators): ensure property key consistency (#2233) 2024-01-31 19:05:52 +08:00
overlookmotel
5279e8955f
refactor(parser): byte handler for illegal bytes (#2229)
This adds a separate byte handler to the lexer for byte values which
should never be encountered:

1. UTF-8 continuation bytes (i.e. middle of a multi-byte UTF-8 byte
sequence).
2. Bytes values which are illegal in valid UTF-8 strings.

At present, this function is impossible to reach, because
`std::str::Chars` ensures the next byte is always the *start* of a valid
UTF-8 byte sequence. But later changes I intend introducing unsafe code
will make it possible (but highly undesirable!). In the meantime, I
don't think it does any harm to handle this case.
2024-01-31 18:57:47 +08:00
Boshen
bd23c3a058
Release @oxc-parser/wasm v0.0.4 2024-01-31 15:56:04 +08:00
Boshen
9c6c17b9aa
feat(wasm/parser): improve FFI (#2232) 2024-01-31 15:53:32 +08:00
Wenzhe Wang
5fb5d8a01e
chore(tasks): update codegen runtime snapshot (#2223) 2024-01-31 12:25:28 +08:00
Wenzhe Wang
fa555ceed8
feat(codegen): change back to read raw (#2222) 2024-01-31 12:17:52 +08:00
Dunqing
2924258ab9
refactor(semantic): adding binder for ImportSpecifier replaces the ModuleDeclaration's binder (#2230)
close: #2013
2024-01-31 11:57:08 +08:00
overlookmotel
3d79d77b40
refactor(parser): split lexer into multiple files (#2228)
This PR has a large diff, but it contains no substantive changes
whatsoever. It purely breaks up the lexer into multiple smaller files.

I've been working quite intensively on the lexer over past few weeks,
but still have been finding it hard to make sense of, due to most of the
logic currently being contained in [a single 1800-line
file](018675ceb1/crates/oxc_parser/src/lexer/mod.rs).

I feel that breaking it up into multiple files makes it much easier to
navigate and understand.

An additional benefit is that many functions can have their visibility
reduced to module scope, so sub-systems for e.g. lexing numbers have
fewer exposed functions. This makes it clearer what the entry points
are, and makes it harder to make mistakes when working on the lexer.

I intend to later make changes to the lexer for performance which will
introduce unsafe code. Keeping that unsafe code encapsulated in modules
will make it more viable to validate the workings of that code, and
avoid accidental UB.

There is one downside to this change. Previously
[`lexer/mod.rs`](018675ceb1/crates/oxc_parser/src/lexer/mod.rs)
was laid out in same order as the JS spec. If you were trying to
validate the lexer against the spec, this would make it easier. However,
as OXC's parser is fairly mature at this point, and I imagine most
spec-compliance issues have been flushed out by now, in my opinion this
advantage is less compelling than it probably used to be. So in my view
it's outweighed by the benefit of more readable code.

Reviewing this could be a bit of a battle due to the size of the diff. I
do have further changes I'd like to make, but I've intentionally kept
this PR as 100% just:

1. Moving code around.
2. Reducing visibility of functions to module/super scope where that's
possible to do without changing anything else.

Aside from that, not even a single comment has changed.

If you're willing to trust me on that promise, I think it can be merged
without poring through it line by line.
2024-01-31 11:43:53 +08:00
Boshen
018675ceb1
Release @oxc-parser/wasm v0.0.3 2024-01-30 21:57:46 +08:00
Boshen
b2894c6a38
Release @oxc-parser/wasm v0.0.2 2024-01-30 21:43:41 +08:00
Boshen
5ac61f09a0
feat: setup wasm parser for npm (#2221) 2024-01-30 21:40:10 +08:00
Dunqing
f673e41539
feat(ast): remove serde skip for symbol_id and reference_id (#2220)
We want to see symbol_id and reference_id in ast
2024-01-30 21:03:05 +08:00
overlookmotel
81e33a3701
perf(parser): faster offset calculation (#2215)
A faster way to calculate offset in the lexer.

This only moves the needle because it's on the hottest path in the lexer
- `Lexer::offset` is called for every token in `Lexer::read_next_token`.
2024-01-30 18:49:31 +08:00
Nicholas Roberts
cd5026c015
feat(ast): TypeScript definition for wasm target (#2158)
Closes #2151
2024-01-30 15:43:03 +08:00
renovate[bot]
d7a9bcf191
chore(deps): update rust crates (#2199) 2024-01-30 15:30:22 +08:00
Maurice Nicholson
981ef6f821
Better source line and column numbers (#2213)
Attempt to improve the graphical reporter source file **line number**
and **column number** .

Currently `oxlint` renders the **line number** as the first line in the
snippet **column number** is always `1` AFAICT. Example of current
version on VS Code repo:


![image](https://github.com/oxc-project/oxc/assets/37007/196947c0-35cf-4bf3-9c4d-656e4b2c7184)

This means that when CTRL-clicking on the source-file:line:col "link" it
takes me to the wrong place.

This PR is an attempt to improve things by getting closer to the source
of the issue. Here is my version again on VS Code:


![image](https://github.com/oxc-project/oxc/assets/37007/9adfb14d-c8ee-4aaa-8ed8-be66b69507fb)

I'm a bit worried that none of the tests failed though - would that be
expected?

Also the approach feels naïve and there may be several cases it won't
work for, or won't work quite so well. Specifically it's just finding
the first labelled-span, but I'm guessing in some cases that could be
providing context, rather than the thing the user would want to change.

As before I'm no expert and any feedback is very much appreciated.

Also in my local testing, VS Code is still a bit unpredictable - even
with the correct line + col it will always go to the correct line number
but doesn't always go to the correct column 🤷 But that's not our issue 😄
2024-01-30 12:26:16 +08:00
overlookmotel
51ac392ae4
refactor(parser): mark ByteHandlers unsafe (#2212)
All the ASCII `ByteHandler`s are unsafe to call. I forgot to mark them
as unsafe when making that change.

This PR fixes that, and will make it harder for someone to accidentally
call one of them without considering the safety invariants.
2024-01-30 12:23:35 +08:00
overlookmotel
20679d1e1e
perf(parser): pad Token to 16 bytes (#2211)
Counter-intuitively, it seems that *increasing* the size of `Token`
improves performance slightly.

This appears to be because when `Token` is 16 bytes, copying `Token` is
a single 16-byte load/store. At present, it's 12 bytes which requires an
8-byte load/store + a 4-byte load/store.

https://godbolt.org/z/KPYsn3ab7

This suggests that either:

1. #2010 could be reverted at no cost, and the overhead of the hash
table removed.
or:
2. We need to get `Token` down to 8 bytes!

I have an idea how to *maybe* do (2), so I'd suggest leaving it as is
for now until I've been able to research that.

NB I also tried putting `#[repr(align(16))]` on `Token` so that copying
uses aligned loads/stores. That [hurt the benchmarks very
slightly](https://codspeed.io/overlookmotel/oxc/branches/lexer-pad-token),
though it might produce a gain on architectures where unaligned loads
are more expensive (ARM64 I think?). But I can't test that theory, so
have left it out.
2024-01-30 11:47:26 +08:00
Dunqing
c62495d23f
refactor(semantic): get function by scope_id in set_function_node_flag (#2208) 2024-01-30 11:43:35 +08:00
overlookmotel
872d751a18
refactor(parser): re-order match branches (#2209)
Just a tiny bit of code tidying.
2024-01-30 00:53:56 +08:00
Wenzhe Wang
9333264428
feat(codegen): print TemplateLiteral with print_str (#2207) 2024-01-29 23:09:29 +08:00
overlookmotel
71898ffdd5
refactor(parser): move source length check into lexer (#2206)
This change makes little difference in itself, but moving the check into
the lexer will allow some optimizations in lexer using unsafe code which
depend on this invariant.
2024-01-29 22:29:02 +08:00
overlookmotel
e123be0a00
fix(parser): correct MAX_LEN for 32-bit systems (#2204)
Maximum length of source parser can accept is limited on 32-bit systems
to `isize::MAX` (i.e. `i32::MAX` not `u32::MAX`) because Rust [limits
the size of
allocations](https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.from_size_align)
to `isize::MAX`.

This PR takes that constraint into account when calculating
`Parser::MAX_LEN`.

It also speeds up the `overlong_source` test so it runs in under 500ms
(previously it took ~4 secs on a M1 Macbook Pro).
2024-01-29 21:45:45 +08:00
Boshen
a1271af5df
docs(allocator): document behaviour of Box 2024-01-29 21:34:45 +08:00
Boshen
a647a47a3c
ci: update renovate bot schedule 2024-01-29 21:32:37 +08:00
kaykdm
da3b3057a2
feat(linter): implement @next/next/no-before-interactive-script-outsi… (#2203)
…de-document

implement @next/next/no-before-interactive-script-outside-document
Related issue: https://github.com/oxc-project/oxc/issues/1929

original implementation

- code:
https://github.com/vercel/next.js/blob/canary/packages/eslint-plugin-next/src/rules/no-before-interactive-script-outside-document.ts
- test:
https://github.com/vercel/next.js/blob/canary/test/unit/eslint-plugin-next/no-before-interactive-script-outside-document.test.ts
- doc:
https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
2024-01-29 21:01:50 +08:00
Dunqing
f59e87f9c4
refactor(semantic): checking label in ContinueStatement based on LabelBuilder (#2202) 2024-01-29 18:24:42 +08:00
kaykdm
b694a6a76e
feat(linter): implement @next/next/no-unwanted-polyfillio (#2197)
implement @next/next/no-unwanted-polyfillio
Related issue: https://github.com/oxc-project/oxc/issues/1929

original implementation

- code:
https://github.com/vercel/next.js/blob/canary/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts
- test:
https://github.com/vercel/next.js/blob/canary/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts
- doc: https://nextjs.org/docs/messages/no-unwanted-polyfillio
2024-01-29 16:45:09 +08:00
renovate[bot]
35ff52aa31
chore(deps): update website npm packages (#2200)
[![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.23.0`
->
`6.23.1`](https://renovatebot.com/diffs/npm/@codemirror%2fview/6.23.0/6.23.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@codemirror%2fview/6.23.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@codemirror%2fview/6.23.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@codemirror%2fview/6.23.0/6.23.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@codemirror%2fview/6.23.0/6.23.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [pnpm](https://pnpm.io) ([source](https://togithub.com/pnpm/pnpm)) |
[`8.14.3` ->
`8.15.0`](https://renovatebot.com/diffs/npm/pnpm/8.14.3/8.15.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pnpm/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pnpm/8.14.3/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/8.14.3/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

###
[`v6.23.1`](https://togithub.com/codemirror/view/blob/HEAD/CHANGELOG.md#6231-2024-01-24)

[Compare
Source](https://togithub.com/codemirror/view/compare/6.23.0...6.23.1)

##### Bug fixes

Fix a bug that caused `Tooltip.above` to not take effect for tooltips
that were already present when the tooltip plugin is initialized.

Automatically reposition tooltips when their size changes.

</details>

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v8.15.0`](https://togithub.com/pnpm/pnpm/releases/tag/v8.15.0)

[Compare
Source](https://togithub.com/pnpm/pnpm/compare/v8.14.3...v8.15.0)

#### Minor Changes

- When the license field does not exist in `package.json` but a license
file exists, try to match and extract the license name
[#&#8203;7530](https://togithub.com/pnpm/pnpm/pull/7530).

#### Patch Changes

- Running `pnpm update -r --latest` will no longer downgrade prerelease
dependencies [#&#8203;7436](https://togithub.com/pnpm/pnpm/issues/7436).
- `--aggregate-output` should work on scripts executed from the same
project [#&#8203;7556](https://togithub.com/pnpm/pnpm/issues/7556).
- Prefer hard links over reflinks on Windows as they perform better
[#&#8203;7564](https://togithub.com/pnpm/pnpm/pull/7564).
- Reduce the length of the side-effects cache key. Instead of saving a
stringified object composed from the dependency versions of the package,
use the hash calculated from the said object
[#&#8203;7563](https://togithub.com/pnpm/pnpm/pull/7563).
- Throw an error if `pnpm update --latest` runs with arguments
containing versions specs. For instance, `pnpm update --latest foo@next`
is not allowed [#&#8203;7567](https://togithub.com/pnpm/pnpm/pull/7567).
- Don't fail in Windows CoW if the file already exists
[#&#8203;7554](https://togithub.com/pnpm/pnpm/issues/7554).

#### Platinum Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://bit.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/bit.svg"
width="80"></a>
      </td>
      <td align="center" valign="middle">
<a href="https://figma.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/figma.svg"
width="80"></a>
      </td>
    </tr>
  </tbody>
</table>

#### Gold Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/discord.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/discord_light.svg" />
<img src="https://pnpm.io/img/users/discord.svg" width="220" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://prisma.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/prisma.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/prisma_light.svg" />
<img src="https://pnpm.io/img/users/prisma.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://uscreen.de/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/uscreen.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/uscreen_light.svg" />
<img src="https://pnpm.io/img/users/uscreen.svg" width="180" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://www.jetbrains.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<img src="https://pnpm.io/img/users/jetbrains.svg" width="85" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/nx.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/nx_light.svg" />
            <img src="https://pnpm.io/img/users/nx.svg" width="120" />
          </picture>
        </a>
      </td>
    </tr>
  </tbody>
</table>

#### Our Silver Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a
href="https://leniolabs.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <img src="https://pnpm.io/img/users/leniolabs.jpg" width="80">
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://vercel.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/vercel.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/vercel_light.svg" />
<img src="https://pnpm.io/img/users/vercel.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://depot.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/depot.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/depot_light.svg" />
<img src="https://pnpm.io/img/users/depot.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://moonrepo.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/moonrepo.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/moonrepo_light.svg" />
<img src="https://pnpm.io/img/users/moonrepo.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a
href="https://www.thinkmill.com.au/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/thinkmill.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/thinkmill_light.svg" />
<img src="https://pnpm.io/img/users/thinkmill.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://devowl.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<img src="https://pnpm.io/img/users/devowlio.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://macpaw.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/macpaw.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/macpaw_light.svg" />
<img src="https://pnpm.io/img/users/macpaw.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
  </tbody>
</table>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on monday" (UTC), 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.

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 16:16:48 +08:00
Dunqing
56adfb1a86
refactor(semantic): use LabelBuilder instead of UnusedLabeled (#2184)
I think `UnusedLabeled` can do more than that.

1. Collect unused label
2. Support check duplication label
3. Support check label in `BreakStatement`
4. Support check label in `ContinueStatement` (Not yet)

But then the `UnusedLabeled` name wouldn't fit, so I renamed it
`LabelBuilder` and moved it to `label.rs`
2024-01-29 15:15:07 +08:00
Dunqing
972be831e9
fix(semantic): fix incorrect semantic example (#2198) 2024-01-29 06:48:47 +00:00