Commit graph

6921 commits

Author SHA1 Message Date
oxc-bot
00a7372eaf
release(crates): v0.38.0 (#7490) 2024-11-26 14:38:47 +08:00
Boshen
45ef3eb2be chore(transformer): disable class properties transform from the target API (#7487) 2024-11-26 06:10:35 +00:00
Boshen
713e210012 chore(transformor): disable class properties transform (#7486)
The plugin is not ready.
2024-11-26 03:47:46 +00:00
Alexander S.
571d7e2419
fix(language_server): calculate correct column when Unicode chars (#7484)
Before:

![grafik](https://github.com/user-attachments/assets/ddae446d-9167-405b-b44e-c7f76850ffd0)

After:

![grafik](https://github.com/user-attachments/assets/e8d7ac5c-8fe9-4c51-897d-bdb55f7f33dc)

Closes #3625
2024-11-26 10:44:13 +08:00
Guillaume Piedigrossi
87c893fb49
feat(linter): add the eslint/no_duplicate_imports rule (#7309) 2024-11-25 20:56:29 +00:00
overlookmotel
e5d49db360 refactor(transformer/class-properties): placeholder method for transforming private field assignment patterns (#7482)
Add a no-op placeholder method for transforming private fields as `AssignmentPattern`s. e.g. `[object.#prop] = []`.

Implementation will be added later.
2024-11-25 20:10:07 +00:00
overlookmotel
97de0b7be1 fix(transformer/class-properties): transform this in static prop initializers (#7481)
Convert `this` in static property initializers to reference to class name.

`class C { static prop = this; }` -> `class C {}; C.prop = C;`
2024-11-25 20:10:05 +00:00
overlookmotel
d2745df3bc fix(transformer/class-properties): stop searching for super() in TSModuleBlocks (#7480)
Fix edge case in class static properties transform. When transforming `super()` in class constructor, stop searching when hit a `TSModuleBlock`. `TSModuleBlock` is essentially a function, so `super()` there is invalid.
2024-11-25 20:10:03 +00:00
overlookmotel
2a5954ae71 docs(transformer/class-properties): document transform options (#7478)
Add docs for the `loose` option / `set_public_class_fields` assumption.
2024-11-25 17:17:28 +00:00
overlookmotel
abb0e0e08e refactor(transformer/class-properties): rename var (#7477)
Pure refactor. Name var more descriptively.
2024-11-25 16:45:21 +00:00
renovate
17fb7e5303 chore(deps): update rust crates (#7467)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [allocator-api2](https://redirect.github.com/zakarumych/allocator-api2) | workspace.dependencies | patch | `0.2.18` -> `0.2.20` |
| [flate2](https://redirect.github.com/rust-lang/flate2-rs) | workspace.dependencies | patch | `1.0.34` -> `1.0.35` |
| [itoa](https://redirect.github.com/dtolnay/itoa) | workspace.dependencies | patch | `1.0.11` -> `1.0.13` |
| [oxc_resolver](https://redirect.github.com/oxc-project/oxc-resolver) | workspace.dependencies | minor | `2.0.0` -> `2.1.1` |
| [proc-macro2](https://redirect.github.com/dtolnay/proc-macro2) | workspace.dependencies | patch | `1.0.89` -> `1.0.92` |
| [serde](https://serde.rs) ([source](https://redirect.github.com/serde-rs/serde)) | workspace.dependencies | patch | `1.0.214` -> `1.0.215` |
| [serde_json](https://redirect.github.com/serde-rs/json) | workspace.dependencies | patch | `1.0.132` -> `1.0.133` |
| [tempfile](https://stebalien.com/projects/tempfile-rs/) ([source](https://redirect.github.com/Stebalien/tempfile)) | workspace.dependencies | minor | `3.13.0` -> `3.14.0` |
| [tokio](https://tokio.rs) ([source](https://redirect.github.com/tokio-rs/tokio)) | workspace.dependencies | patch | `1.41.0` -> `1.41.1` |
| [url](https://redirect.github.com/servo/rust-url) | workspace.dependencies | patch | `2.5.3` -> `2.5.4` |

---

### Release Notes

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

### [`v1.0.35`](https://redirect.github.com/rust-lang/flate2-rs/releases/tag/1.0.35): - security update to zlib-rs

[Compare Source](https://redirect.github.com/rust-lang/flate2-rs/compare/1.0.34...1.0.35)

#### What's Changed

-   Upgrade actions/upload-artifact by [@&#8203;jdno](https://redirect.github.com/jdno) in [https://github.com/rust-lang/flate2-rs/pull/438](https://redirect.github.com/rust-lang/flate2-rs/pull/438)
-   upgrade zlib-rs to version `0.4.0` by [@&#8203;folkertdev](https://redirect.github.com/folkertdev) in [https://github.com/rust-lang/flate2-rs/pull/439](https://redirect.github.com/rust-lang/flate2-rs/pull/439)

#### New Contributors

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

**Full Changelog**: https://github.com/rust-lang/flate2-rs/compare/1.0.34...1.0.35

</details>

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

### [`v1.0.13`](https://redirect.github.com/dtolnay/itoa/releases/tag/1.0.13)

[Compare Source](https://redirect.github.com/dtolnay/itoa/compare/1.0.12...1.0.13)

-   Code cleanup ([#&#8203;48](https://redirect.github.com/dtolnay/itoa/issues/48), [#&#8203;49](https://redirect.github.com/dtolnay/itoa/issues/49), [#&#8203;50](https://redirect.github.com/dtolnay/itoa/issues/50), [#&#8203;51](https://redirect.github.com/dtolnay/itoa/issues/51), [#&#8203;52](https://redirect.github.com/dtolnay/itoa/issues/52), [#&#8203;53](https://redirect.github.com/dtolnay/itoa/issues/53), [#&#8203;54](https://redirect.github.com/dtolnay/itoa/issues/54), [#&#8203;55](https://redirect.github.com/dtolnay/itoa/issues/55))

### [`v1.0.12`](https://redirect.github.com/dtolnay/itoa/releases/tag/1.0.12)

[Compare Source](https://redirect.github.com/dtolnay/itoa/compare/1.0.11...1.0.12)

-   Add itoa::Integer::MAX_STR_LEN associated constant ([#&#8203;45](https://redirect.github.com/dtolnay/itoa/issues/45), thanks [@&#8203;SUPERCILEX](https://redirect.github.com/SUPERCILEX))

</details>

<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>

### [`v2.1.1`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#211---2024-11-22)

[Compare Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v2.1.0...oxc_resolver-v2.1.1)

##### Performance

-   reduce hash while resolving package.json ([#&#8203;319](https://redirect.github.com/oxc-project/oxc-resolver/pull/319))
-   reduce memory allocation while normalizing package path ([#&#8203;318](https://redirect.github.com/oxc-project/oxc-resolver/pull/318))
-   reduce memory allocation while resolving package.json ([#&#8203;317](https://redirect.github.com/oxc-project/oxc-resolver/pull/317))
-   use `path.as_os_str().hash()` instead of `path.hash()` ([#&#8203;316](https://redirect.github.com/oxc-project/oxc-resolver/pull/316))
-   reduce memory allocation by using a thread_local path for path methods ([#&#8203;315](https://redirect.github.com/oxc-project/oxc-resolver/pull/315))

##### Other

-   remove the deprecated simdutf8 aarch64\_neon feature
-   mention extension must start with a `.` in `with_extension` ([#&#8203;313](https://redirect.github.com/oxc-project/oxc-resolver/pull/313))

### [`v2.1.0`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#210---2024-11-20)

[Compare Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v2.0.1...oxc_resolver-v2.1.0)

##### Added

-   add `Resolver::resolve_tsconfig` API ([#&#8203;312](https://redirect.github.com/oxc-project/oxc-resolver/pull/312))

##### Fixed

-   don't panic when resolving `/` with `roots` ([#&#8203;310](https://redirect.github.com/oxc-project/oxc-resolver/pull/310))
-   use same UNC path normalization logic with libuv ([#&#8203;306](https://redirect.github.com/oxc-project/oxc-resolver/pull/306))

##### Other

-   *(deps)* update rust crates to v1.0.215
-   fix symlink test init on windows ([#&#8203;307](https://redirect.github.com/oxc-project/oxc-resolver/pull/307))

### [`v2.0.1`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#201---2024-11-08)

[Compare Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v2.0.0...oxc_resolver-v2.0.1)

##### Other

-   `cargo upgrade` && `pnpm upgrade`
-   bring back the symlink optimization ([#&#8203;298](https://redirect.github.com/oxc-project/oxc-resolver/pull/298))
-   *(deps)* update rust crate criterion2 to v2

</details>

<details>
<summary>dtolnay/proc-macro2 (proc-macro2)</summary>

### [`v1.0.92`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.92)

[Compare Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.91...1.0.92)

-   Improve compiler/fallback mismatch panic message ([#&#8203;487](https://redirect.github.com/dtolnay/proc-macro2/issues/487))

### [`v1.0.91`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.91)

[Compare Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.90...1.0.91)

-   Fix panic *"compiler/fallback mismatch 949"* when using TokenStream::from_str from inside a proc macro to parse a string containing doc comment ([#&#8203;484](https://redirect.github.com/dtolnay/proc-macro2/issues/484))

### [`v1.0.90`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.90)

[Compare Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.89...1.0.90)

-   Improve error recovery in TokenStream's and Literal's FromStr implementations to work around [https://github.com/rust-lang/rust/issues/58736](https://redirect.github.com/rust-lang/rust/issues/58736) such that rustc does not poison compilation on codepaths that should be recoverable errors ([#&#8203;477](https://redirect.github.com/dtolnay/proc-macro2/issues/477), [#&#8203;478](https://redirect.github.com/dtolnay/proc-macro2/issues/478), [#&#8203;479](https://redirect.github.com/dtolnay/proc-macro2/issues/479), [#&#8203;480](https://redirect.github.com/dtolnay/proc-macro2/issues/480), [#&#8203;481](https://redirect.github.com/dtolnay/proc-macro2/issues/481), [#&#8203;482](https://redirect.github.com/dtolnay/proc-macro2/issues/482))

</details>

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

### [`v1.0.215`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.215)

[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.214...v1.0.215)

-   Produce warning when multiple fields or variants have the same deserialization name ([#&#8203;2855](https://redirect.github.com/serde-rs/serde/issues/2855), [#&#8203;2856](https://redirect.github.com/serde-rs/serde/issues/2856), [#&#8203;2857](https://redirect.github.com/serde-rs/serde/issues/2857))

</details>

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

### [`v1.0.133`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.133)

[Compare Source](https://redirect.github.com/serde-rs/json/compare/v1.0.132...v1.0.133)

-   Implement From<\[T; N]> for serde_json::Value ([#&#8203;1215](https://redirect.github.com/serde-rs/json/issues/1215))

</details>

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

### [`v3.14.0`](https://redirect.github.com/Stebalien/tempfile/blob/HEAD/CHANGELOG.md#3140)

[Compare Source](https://redirect.github.com/Stebalien/tempfile/compare/v3.13.0...v3.14.0)

-   Make the wasip2 target work (requires tempfile's "nightly" feature to be enabled). [#&#8203;305](https://redirect.github.com/Stebalien/tempfile/pull/305).
-   Allow older windows-sys versions [#&#8203;304](https://redirect.github.com/Stebalien/tempfile/pull/304).

</details>

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

### [`v1.41.1`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.41.1): Tokio v1.41.1

[Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.41.0...tokio-1.41.1)

### 1.41.1 (Nov 7th, 2024)

##### Fixed

-   metrics: fix bug with wrong number of buckets for the histogram ([#&#8203;6957])
-   net: display `net` requirement for `net::UdpSocket` in docs ([#&#8203;6938])
-   net: fix typo in `TcpStream` internal comment ([#&#8203;6944])

[#&#8203;6957]: https://redirect.github.com/tokio-rs/tokio/pull/6957

[#&#8203;6938]: https://redirect.github.com/tokio-rs/tokio/pull/6938

[#&#8203;6944]: https://redirect.github.com/tokio-rs/tokio/pull/6944

</details>

<details>
<summary>servo/rust-url (url)</summary>

### [`v2.5.4`](https://redirect.github.com/servo/rust-url/releases/tag/v2.5.4)

[Compare Source](https://redirect.github.com/servo/rust-url/compare/v2.5.3...v2.5.4)

##### What's Changed

-   Revert "Normalize URL paths: convert /.//p, /..//p, and //p to p ([#&#8203;943](https://redirect.github.com/servo/rust-url/issues/943))" by [@&#8203;valenting](https://redirect.github.com/valenting) in [https://github.com/servo/rust-url/pull/999](https://redirect.github.com/servo/rust-url/pull/999)
-   Updates the MSRV to 1.63 required though the libc v0.2.164 dependency

**Full Changelog**: https://github.com/servo/rust-url/compare/v2.5.3...v2.5.4

</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 is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.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://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2024-11-25 16:10:34 +00:00
Boshen
ed6a69e2db
chore(coverage): update runtime.snap 2024-11-25 22:36:05 +08:00
overlookmotel
25823c8529 refactor(transformer/class-properties): safer use of GetAddress (#7474)
Avoid using `Address::from_ptr`, which is error-prone.
2024-11-25 14:25:27 +00:00
overlookmotel
3396b69379 refactor(transformer/exponentiation-operator): correct comment (#7476)
Follow-on after #7410. Update comment to reflect the changed logic.
2024-11-25 14:16:22 +00:00
overlookmotel
10ea830651 style(traverse): fix indentation in codegen (#7475) 2024-11-25 13:19:19 +00:00
overlookmotel
eb70219821 feat(ast): derive GetAddress on all enum types (#7472)
Implement `GetAddress` on all AST enums where all variants are boxed. Part of #7339.
2024-11-25 12:13:44 +00:00
Dunqing
d7d073578d refactor(semantic): remove SymbolFlags::TypeLiteral (#7415) 2024-11-25 11:34:34 +00:00
jordan boyer
79ab8cca0e
feat(lint-unicorn): add rule prefer set has (#7075)
implementing the rule [prefer set
has](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md)
from unicorn.

I put the fix as dangerous fix because they was no test for the fix on
the unicorn part. I did add some test for this but i'm not sure that i'm
covering everything.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2024-11-25 19:33:51 +08:00
overlookmotel
a68a2172d2 refactor(ast_tools): move prelude above derive in Derives (#7471)
Pure refactor. Prelude is printed first, so it makes sense to define it first.
2024-11-25 11:08:31 +00:00
Jelle van der Waa
7236d14dc8
feat(eslint/jsx_a11y): implement anchor_ambiguous_text (#5729)
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2024-11-25 11:07:36 +00:00
overlookmotel
111d722fe1 style(transformer/optional-chaining): code style nit (#7468) 2024-11-25 10:51:42 +00:00
Dunqing
e26916ceae perf(transformer/optional-chaining): mark enter_expression as inline (#7390) 2024-11-25 18:31:35 +08:00
overlookmotel
9778298fdb feat(transformer): class properties transform (#7011)
Add class properties transform.

Implementation is incomplete. Notable missing parts:

* Scopes are not updated where property initializers move from class body into class constructor / `_super` function.
* Does not handle binding shadowing problems when property initializers move from class body into class constructor.
* `this` and references to class name in static property initializers need to be transformed to point to a temp var.
* Not all usages of private properties are supported (see below).
* Code which is moved to outside of class body is not transformed by other transforms for class declarations (works OK for class expressions). This includes static property initializers, static blocks, and computed property/method keys.
* Only basic checks for whether computed property/method keys may have side effects.
* Numerous other small issues noted in TODO comments through the code.

### Private properties

Currently does not handle the following usages of private properties:

```js
class Class {
  #prop;
  static #static;

  method() {
    object?.#prop;
    object?.#prop();
    [object.#prop] = [1];
    ({x: object.#prop} = {x: 1});
    object.#prop`xyz`;

    object?.#static;
    object?.#static();
    [object.#static] = [1];
    ({x: object.#static} = {x: 1});
    object.#static`xyz`;
  }
}
```
2024-11-25 10:24:20 +00:00
overlookmotel
3b2a3477d4 test(transformer): script to amend Babel fixtures (#7122)
Add a NodeJS script which amends Babel's fixtures in place to remove transform plugins which we don't support from `options.json` files. Where options are changed from the original, the script runs Babel transform with the new options to regenerate the fixture `output.js` files.

Currently limited to transforming the fixtures for `babel-plugin-transform-class-properties` transform, but we can also enable it for other plugins if we wish in future, to get additional test coverage.
2024-11-25 10:24:19 +00:00
Boshen
3169bc61d1
ci: clean up wasm type check (#7466)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-25 17:56:17 +08:00
Brian Liu
0b9da38a9e
feat(linter): implement unicorn/prefer-negative-index (#6920)
[unicorn/prefer-negative-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v56.0.0/docs/rules/prefer-negative-index.md)

---------

Co-authored-by: Brian Liu <brian@redflagsdating.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2024-11-25 09:25:15 +00:00
Boshen
ecd0c0807f
ci: add type check for oxc_wasm.d.ts (#7465) 2024-11-25 16:52:35 +08:00
Radu Baston
f0643c4484
feat(linter): implement jsx-no-script-url (#6995)
https://github.com/oxc-project/oxc/issues/1022

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-25 16:49:27 +08:00
Boshen
5d65656517 refactor(oxc_index)!: move to own repo github.com/oxc-project/oxc-index-vec (#7464)
closes #7454
2024-11-25 08:36:44 +00:00
overlookmotel
7090b3229e
ci(dev): fix .editorconfig (#7457)
#7401 set indent to 4 spaces in `.editorconfig`. But our convention is 2
spaces for JS, YAML and JSON files. Update `.editorconfig` to reflect
this.
2024-11-25 16:33:39 +08:00
dalaoshu
db6558f33c
fix(linter): false positive in eslint/prefer-object-has-own (#7463)
closes #7450
2024-11-25 16:32:48 +08:00
Alexander S.
a3ecbde369
fix(language_server): do not tell clients about codeActionProvider when they do not support codeActionLiteralSupport (#7445)
VSCode output:

```
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
```

See also eslint implementation
b33437b5ad/server/src/eslintServer.ts (L221-L225)
2024-11-25 14:30:02 +08:00
Alexander S.
25d9ed9b10
fix(language_server): revalidate files when configPath has changed (#7447)
closes #7446 

![revalidate-files-when-config-changes](https://github.com/user-attachments/assets/a5f4a612-9e0d-4f14-932c-f3b9b956a24a)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-25 14:29:26 +08:00
Dunqing
88ddce4fa6 chore(isolated-declarations): remove outdated panic comment (#7462) 2024-11-25 05:28:09 +00:00
Dunqing
0ff94fa620 refactor(isolated-declarations): use CloneIn instead of ast.copy (#7459) 2024-11-25 04:56:17 +00:00
IWANABETHATGUY
e9f9e8242a feat(oxc_transformer): replace_global_define ThisExpression (#7443)
Test from d34e79e2a9/internal/bundler_tests/bundler_default_test.go (L5195-L5260),

esbuild snapshot:

d34e79e2a9/internal/bundler_tests/snapshots/snapshots_default.txt (L1081-L1108)
2024-11-25 04:13:52 +00:00
Boshen
6f161de10f chore(coverage): bump test262, babel and TypeScript submodules (#7452) 2024-11-24 16:26:45 +00:00
Boshen
e7423cfc87
ci: remove setup-bun 2024-11-25 00:02:21 +08:00
IWANABETHATGUY
87978499a3
feat(oxc_transformer): replace_global_define destructuring assignment optimization (#7449)
1. Closed #7382

Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>
2024-11-24 23:24:32 +08:00
Hiroshi Ogawa
d5df615264
fix(oxc_codegen): don't emit empty span mapping (#7448) 2024-11-24 17:04:52 +08:00
Alexander S.
b04041d1cf
fix(vscode)!: use .oxlintrc.json as default value for oxc.configPath (#7442)
**BREAKING CHANGE**: VSCode-Client does not watch for `eslint`
configuration files. Default value for `oxc.configPath` is now
`.oxlintrc.json` instead of `.eslintrc`
2024-11-24 12:32:44 +08:00
Alexander S.
84fcc43cf5
docs(language_server): add readme (#7429)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-24 12:31:23 +08:00
Naoya Yoshizawa
00060ca0f1
feat(linter): Implement eslint/no-object-constructor (#7345)
A test case for `new Object()` has been commented out:

This is due to the test configuration specifying `globals: { Object:
"off" }`.
This approach follows the example set by the no_new_wrappers rule.
[Reference
Code](bf839c1dfa/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs (L88))

---------

Co-authored-by: no-yan <63000297+no-yan@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2024-11-23 19:17:51 +00:00
Boshen
59e7e4674f feat(napi/transform): add TransformOptions::target API (#7426) 2024-11-23 15:46:33 +00:00
oxc-bot
88d17b96e3
release(oxlint): v0.13.1 (#7441)
## [0.13.1] - 2024-11-23

### Features

- 4ad26b9 linter: Add `no-promise-in-callback` (#7307) (no-yan)
- 9558087 oxlint: Auto detect config file in CLI (#7348) (Alexander S.)

### Bug Fixes

- 8507464 linter: Hanging when source has syntax/is flow (#7432)
(Cameron)
- e88cf1b linter: Make `overrides` globs relative to config path (#7407)
(camchenry)
- 9002e97 linter: Add proper support for findIndex and findLastIndex for
`unicorn/prefer-array-some` (#7405) (Dmitry Zakharov)

### Documentation

- 6730e3e linter: Add more examples for `unicorn/prefer-array-some`
(#7411) (Dmitry Zakharov)

### Refactor

- 6c0d31b linter: Remove useless `const` declaration (#7430) (Song Gao)
- c8adc46 linter/no-unused-vars: Improve implementation to remove using
SymbolFlags::Export (#7412) (Dunqing)
- c90537f linter/only-used-in-recursion: Improve implementation to
remove using SymbolFlags::Export (#7413) (Dunqing)

### Testing

- 779f479 editor: Check if workspace configuration is updated (#7403)
(Alexander S.)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-11-23 23:46:16 +08:00
IWANABETHATGUY
4bb1dca673 feat(oxc_transformer): ReplaceGlobalDefines for ChainExpr (#7433) 2024-11-23 15:21:30 +00:00
Cameron
8507464d5a
fix(linter): hanging when source has syntax/is flow (#7432)
Closes #7406

See
https://github.com/oxc-project/oxc/issues/7406#issuecomment-2494981152
for why this is happening

not sure whether there's a better solve for this/
2024-11-23 23:20:19 +08:00
Cameron
c6d790b287
fix(language-server): fix panic by building scope tree child ids (#7440)
closes #7434

i couldn't test this. but what's happening is semaitc is being build
without scope child ids. When exhaustive_deps tries to access it its an
empty vec - hence the panic
2024-11-23 23:19:11 +08:00
dalaoshu
d8c093126d
feat(oxc_transformer): use better diagnostic message for ReplaceGlobalDefinesPlugin (#7439)
When I was handling plugin-related diagnostics in `rolldown`, I
encountered this issue.

If there is a define key like `a.6.b`, the error message states that
<code>\`a.6.b\` is not an identifier</code>. However, it should actually
be that <code>\`6\` is not an identifier</code>.
2024-11-23 23:18:36 +08:00
Alexander S.
9558087db9
feat(oxlint): auto detect config file in CLI (#7348)
waiting fior #7352

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-23 23:17:05 +08:00