Boshen
4e5c73b87c
fix(span)!: SourceType::from_path(".js") return js instead of jsx ( #11038 )
...
closes #11020
Previously `SourceType::from_path(".js")` treats a `.js` file as `.jsx`
to maximize parse rate for the linter.
Force the `.jsx` change in the linter instead of a generic solution for
`SourceType::from_path`.
2025-05-15 16:58:00 +08:00
camc314
09612962aa
fix(linter): add gitlab to linter --help docs ( #10932 )
...
before:
```
Output
-f, --format=ARG Use a specific output format. Possible values: `checkstyle`,
`default`, `github`, `json`, `junit`, `stylish`, `unix`
```
after:
```
Output
-f, --format=ARG Use a specific output format. Possible values: `checkstyle`,
`default`, `github`, `gitlab`, `json`, `junit`, `stylish`, `unix`
```
2025-05-10 14:37:23 +00:00
Connor Pearson
466c24a777
feat(linter): add gitlab reporter output format ( #10927 )
...
closes #10352
Adds support for outputting a gitlab code quality report. Modeled mostly
on the JSON and Github reporters.
e.g `oxlint --format gitlab > codequality.json`
2025-05-09 23:48:03 +01:00
Ulrich Stark
bb999a3b80
refactor(language_server): avoid cloning linter by taking reference in LintService ( #10907 )
2025-05-09 09:49:54 +01:00
oxc-bot
cbf3134ee5
release(oxlint): v0.16.10 ( #10916 )
2025-05-09 14:49:42 +08:00
camc314
79819cc12b
refactor(linter): move around some config store logic ( #10861 )
...
this PR moves all of the config resolution for a single file into the `ConfigStore` structure, rather than half existing in `oxc_linter` and half in `oxlint` crates
2025-05-08 11:21:19 +00:00
camc314
e132abaf5b
refactor(linter): extract nested config searching to a fn ( #10860 )
...
moves the nested config code out into a functin to improve readability + prep for future changes
2025-05-07 14:38:04 +00:00
camc314
4c6234823c
feat(linter): regex/no-useless-backreference ( #10773 )
2025-05-07 08:39:22 +00:00
camc314
efb4fb8e21
refactor(oxlint): avoid result unwrap ( #10836 )
2025-05-06 16:16:03 +00:00
oxc-bot
f400a1101f
release(oxlint): v0.16.9 ( #10765 )
2025-05-03 21:13:58 +08:00
x6eull
63f02a8d1c
feat(linter): add react/forward_ref_uses_ref ( #10506 )
...
Related to https://github.com/oxc-project/oxc/issues/1022
Add react/forward-ref-uses-ref.
Rule doc:
https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forward-ref-uses-ref.md
2025-05-01 21:03:27 -04:00
camc314
e7c2b322bb
fix(linter): move consistent-assert to pedantic ( #10665 )
...
`correctness` is not the correct category here. it is more style/pedantic
2025-04-28 12:29:40 +00:00
Shota Kitahara
eac205fcc4
feat(linter): add unicorn/consistent-assert rule ( #10653 )
...
Relates to #684
Rule
detail:https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v58.0.0/docs/rules/consistent-assert.md
2025-04-28 11:15:37 +01:00
oxc-bot
573cb0589c
release(oxlint): v0.16.8 ( #10636 )
2025-04-27 19:11:12 +08:00
Ulrich Stark
723b4c698d
fix(linter): cross_module of LintService not being enabled despite enabled import plugin ( #10597 )
...
Running `oxlint --import-plugin` with no `oxlintrc.json` didn't enable
`cross_module` of `LintService`, because `use_nested_config` was `true`
and `nested_configs` empty in that case. This leads to rules like
`import/no-cycle` not working.
2025-04-26 00:24:52 +02:00
Ben Jones
9a0206693a
fix(oxlint): current dir as arg ( #9382 )
...
closes #9023
When passing `.` as an arg it would result in a path like `{cwd}/.`,
which when being used to resolve other paths obviously caused issues.
This canonicalizes any path args before doing anything else.
Adds test to verify this based on original issue. This also caused
another snapshot to change for an invalid file extension, changing from
`LintSucceeded` to `LintNoFilesFound`, which I believe is actually
correct? If you only pass files that do not exist it would make more
sense to return an error to me so I'm viewing this as a side effect fix.
2025-04-24 11:45:55 +08:00
oxc-bot
d4687e765b
release(oxlint): v0.16.7 ( #10526 )
2025-04-21 23:05:48 +08:00
camchenry
5ab4d40309
refactor(linter): simplify error handling ( #10404 )
...
adds some helper functions to simply the error handling for the oxlint CLI. not perfect by any means, but at least a little simpler to read.
2025-04-18 16:14:10 +00:00
Florian Bopp
4e1f536ab1
fix(linter): config path resolution when path contains '..' syntax ( #10367 )
...
Improved the `find_oxlint_config` function to handle paths containing
parent references ( ../.. syntax )
Added unit tests to verify behavior for valid and invalid config paths,
including cases with parent directory references.
2025-04-14 18:25:19 +08:00
oxc-bot
a83148c8a9
release(oxlint): v0.16.6 ( #10388 )
2025-04-14 11:49:26 +08:00
Sysix
aa6ccd28ca
test(oxlint): add test for nested and extended configuration with import plugin ( #10372 )
...
Added same tests for #10268 , but it's currently not working there
2025-04-12 18:31:25 +00:00
Sub
9aaba6944a
fix(linter): nested configuration directory resolution ( #10157 )
...
Fixes https://github.com/oxc-project/oxc/issues/10156
I'm not very familiar with the inner workings of this project - this was
a fix based on what I could understand after exploring the codebase for
the first time. @camchenry It would be great to get your eyes on this
since you are familiar with the nested config implementation.
2025-04-08 00:07:31 -04:00
oxc-bot
9c1628d482
release(oxlint): v0.16.5 ( #10287 )
2025-04-07 17:22:48 +08:00
Alexander S.
f2eff56e60
fix(linter): fix rule_id for some diagnostics formats ( #10251 )
...
closes #10204
2025-04-05 20:30:33 +08:00
Ulrich Stark
b34e876b00
perf(linter): avoid cloning filters by refactoring functions to take references ( #10247 )
2025-04-05 11:13:18 +08:00
overlookmotel
d6917010bd
fix(various): unwrap Result of write! macro ( #10228 )
...
#10196 replaced the anti-pattern of `str.push_str(&format!("..."));` with `let _ = write!(str, "...");`.
However, this ignores the `Result` returned by `write!` macro. It's unspecified what happens when the `String` reaches capacity - it may return `Result::Err`, or may panic. Ensure we get a panic, rather than silently generating incorrect output by calling `unwrap()` on the `Result`.
This problem could never arise in practice on 64-bit systems because max capacity of `String` is enormous, but it's not impossible on 32-bit systems (e.g. WASM).
2025-04-04 14:38:26 +00:00
renovate
a788a64649
chore(deps): update dependency rust to v1.86.0 ( #10196 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.85.1` -> `1.86.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.86.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1860-2025-04-03 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.85.1...1.86.0 )
\==========================
<a id="1.86.0-Language"></a>
## Language
- [Stabilize upcasting trait objects to supertraits.](https://redirect.github.com/rust-lang/rust/pull/134367 )
- [Allow safe functions to be marked with the `#[target_feature]` attribute.](https://redirect.github.com/rust-lang/rust/pull/134090 )
- [The `missing_abi` lint now warns-by-default.](https://redirect.github.com/rust-lang/rust/pull/132397 )
- Rust now lints about double negations, to catch cases that might have intended to be a prefix decrement operator (`--x`) as written in other languages. This was previously a clippy lint, `clippy::double_neg`, and is [now available directly in Rust as `double_negations`.](https://redirect.github.com/rust-lang/rust/pull/126604 )
- [More pointers are now detected as definitely not-null based on their alignment in const eval.](https://redirect.github.com/rust-lang/rust/pull/133700 )
- [Empty `repr()` attribute applied to invalid items are now correctly rejected.](https://redirect.github.com/rust-lang/rust/pull/133925 )
- [Inner attributes `#![test]` and `#![rustfmt::skip]` are no longer accepted in more places than intended.](https://redirect.github.com/rust-lang/rust/pull/134276 )
<a id="1.86.0-Compiler"></a>
## Compiler
- [Debug-assert that raw pointers are non-null on access.](https://redirect.github.com/rust-lang/rust/pull/134424 )
- [Change `-O` to mean `-C opt-level=3` instead of `-C opt-level=2` to match Cargo's defaults.](https://redirect.github.com/rust-lang/rust/pull/135439 )
- [Fix emission of `overflowing_literals` under certain macro environments.](https://redirect.github.com/rust-lang/rust/pull/136393 )
<a id="1.86.0-Platform-Support"></a>
## Platform Support
- [Replace `i686-unknown-redox` target with `i586-unknown-redox`.](https://redirect.github.com/rust-lang/rust/pull/136698 )
- [Increase baseline CPU of `i686-unknown-hurd-gnu` to Pentium 4.](https://redirect.github.com/rust-lang/rust/pull/136700 )
- New tier 3 targets:
- [`{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock`](https://redirect.github.com/rust-lang/rust/pull/133631 ).
For supporting Neutrino QNX 7.1 with `io-socket` network stack.
- [`{aarch64-unknown,x86_64-pc}-nto-qnx800`](https://redirect.github.com/rust-lang/rust/pull/133631 ).
For supporting Neutrino QNX 8.0 (`no_std`-only).
- [`{x86_64,i686}-win7-windows-gnu`](https://redirect.github.com/rust-lang/rust/pull/134609 ).
Intended for backwards compatibility with Windows 7. `{x86_64,i686}-win7-windows-msvc` are the Windows MSVC counterparts that already exist as Tier 3 targets.
- [`amdgcn-amd-amdhsa`](https://redirect.github.com/rust-lang/rust/pull/134740 ).
- [`x86_64-pc-cygwin`](https://redirect.github.com/rust-lang/rust/pull/134999 ).
- [`{mips,mipsel}-mti-none-elf`](https://redirect.github.com/rust-lang/rust/pull/135074 ).
Initial bare-metal support.
- [`m68k-unknown-none-elf`](https://redirect.github.com/rust-lang/rust/pull/135085 ).
- [`armv7a-nuttx-{eabi,eabihf}`, `aarch64-unknown-nuttx`, and `thumbv7a-nuttx-{eabi,eabihf}`](https://redirect.github.com/rust-lang/rust/pull/135757 ).
Refer to Rust's \[platform support page]\[platform-support-doc]
for more information on Rust's tiered platform support.
<a id="1.86.0-Libraries"></a>
## Libraries
- The type of `FromBytesWithNulError` in `CStr::from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>` was [changed from an opaque struct to an enum](https://redirect.github.com/rust-lang/rust/pull/134143 ), allowing users to examine why the conversion failed.
- [Remove `RustcDecodable` and `RustcEncodable`.](https://redirect.github.com/rust-lang/rust/pull/134272 )
- [Deprecate libtest's `--logfile` option.](https://redirect.github.com/rust-lang/rust/pull/134283 )
- [On recent versions of Windows, `std::fs::remove_file` will now remove read-only files.](https://redirect.github.com/rust-lang/rust/pull/134679 )
<a id="1.86.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`{float}::next_down`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_down )
- [`{float}::next_up`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_up )
- [`<[_]>::get_disjoint_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_mut )
- [`<[_]>::get_disjoint_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_unchecked_mut )
- [`slice::GetDisjointMutError`](https://doc.rust-lang.org/stable/std/slice/enum.GetDisjointMutError.html )
- [`HashMap::get_disjoint_mut`](https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_mut )
- [`HashMap::get_disjoint_unchecked_mut`](https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_unchecked_mut )
- [`NonZero::count_ones`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.count_ones )
- [`Vec::pop_if`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pop_if )
- [`sync::Once::wait`](https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait )
- [`sync::Once::wait_force`](https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait_force )
- [`sync::OnceLock::wait`](https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html#method.wait )
These APIs are now stable in const contexts:
- [`hint::black_box`](https://doc.rust-lang.org/stable/std/hint/fn.black_box.html )
- [`io::Cursor::get_mut`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_mut )
- [`io::Cursor::set_position`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.set_position )
- [`str::is_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.is_char_boundary )
- [`str::split_at`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at )
- [`str::split_at_checked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_checked )
- [`str::split_at_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut )
- [`str::split_at_mut_checked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut_checked )
<a id="1.86.0-Cargo"></a>
## Cargo
- [When merging, replace rather than combine configuration keys that refer to a program path and its arguments.](https://redirect.github.com/rust-lang/cargo/pull/15066/ )
- [Error if both `--package` and `--workspace` are passed but the requested package is missing.](https://redirect.github.com/rust-lang/cargo/pull/15071/ ) This was previously silently ignored, which was considered a bug since missing packages should be reported.
- [Deprecate the token argument in `cargo login` to avoid shell history leaks.](https://redirect.github.com/rust-lang/cargo/pull/15057/ )
- [Simplify the implementation of `SourceID` comparisons.](https://redirect.github.com/rust-lang/cargo/pull/14980/ ) This may potentially change behavior if the canonicalized URL compares differently in alternative registries.
<a id="1.86.0-Rustdoc"></a>
## Rustdoc
- [Add a sans-serif font setting.](https://redirect.github.com/rust-lang/rust/pull/133636 )
<a id="1.86.0-Compatibility-Notes"></a>
## Compatibility Notes
- [The `wasm_c_abi` future compatibility warning is now a hard error.](https://redirect.github.com/rust-lang/rust/pull/133951 )
Users of `wasm-bindgen` should upgrade to at least version 0.2.89, otherwise compilation will fail.
- [Remove long-deprecated no-op attributes `#![no_start]` and `#![crate_id]`.](https://redirect.github.com/rust-lang/rust/pull/134300 )
- [The future incompatibility lint `cenum_impl_drop_cast` has been made into a hard error.](https://redirect.github.com/rust-lang/rust/pull/135964 ) This means it is now an error to cast a field-less enum to an integer if the enum implements `Drop`.
- [SSE2 is now required for "i686" 32-bit x86 hard-float targets; disabling it causes a warning that will become a hard error eventually.](https://redirect.github.com/rust-lang/rust/pull/137037 )
To compile for pre-SSE2 32-bit x86, use a "i586" target instead.
<a id="1.86.0-Internal-Changes"></a>
## Internal Changes
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Build the rustc on AArch64 Linux with ThinLTO + PGO.](https://redirect.github.com/rust-lang/rust/pull/133807 )
The ARM 64-bit compiler (AArch64) on Linux is now optimized with ThinLTO and PGO, similar to the optimizations we have already performed for the x86-64 compiler on Linux. This should make it up to 30% faster.
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, 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://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjcuMyIsInVwZGF0ZWRJblZlciI6IjM5LjIyNy4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2025-04-04 07:43:00 +00:00
camchenry
2f6810a6aa
feat(editor): add named fixes for code actions ( #10203 )
...
- related to https://github.com/oxc-project/oxc/issues/10038
This allows a `Fix` to have a message associated with it as well, similar to `RuleFix`. This is used by the editor to show code actions for a given lint error. For a start, I've added a message to the `no-debugger` rule and modified a test that shows this gets an improved code action message in VS Code.
2025-04-04 02:38:34 +00:00
overlookmotel
66a0001e64
style(all): remove unnecessary semi-colons ( #10198 )
...
Remove unnecessary semi-colons. Flagged by clippy in Rust 1.86.0.
2025-04-03 11:44:34 +00:00
oxc-bot
de45c5e433
release(oxlint): v0.16.4 ( #10155 )
...
## [0.16.4] - 2025-04-01
- da6336c language_server: [**BREAKING**] Remove `enable` configuration,
the client should shutdown the server instead (#9990 ) (Sysix)
### Features
- 06e3db9 linter: Support `multipleFileExtensions` option for
`unicorn/filename-case` (#10118 ) (shulaoda)
- dbe0e46 linter: Support `ignore` option for `unicorn/filename-case`
(#10107 ) (shulaoda)
### Bug Fixes
- 0a33e27 editor: Update `initializationOptions` for a possible restart
(#10121 ) (Sysix)
- ac780a2 editor: Repair filewatchers when no custom config provided
(#10104 ) (Sysix)
- 4303ace editor: Dont send `didChangeConfiguration` request to the
server when it is shutdown (#10084 ) (Sysix)
- 07f2a25 editor: Enable regex parsing in language server (#10035 )
(camchenry)
- fcf7702 language_server: Start from a default oxlint configuration +
SafeFix for nested configuration (#10043 ) (Sysix)
- aba3654 linter: Span disable directive correctly on next line (#10141 )
(Ulrich Stark 🦀 )
- 2c80858 linter: Enable multi-file analysis for nested configs (#10089 )
(camchenry)
### Performance
- 566be59 linter: Replace `phf_set` with `array` in `eslint/func-names`
(#10119 ) (shulaoda)
- 5e14fe9 linter: Inline `PRE_DEFINE_VAR` and use `array` format
(#10079 ) (shulaoda)
### Refactor
- 327be53 editor: `LanguageClient` can be undefined (#10112 ) (Sysix)
- 5ec477c editor: Make `onConfigChange` async (#10110 ) (Sysix)
- a278d73 editor: Use warning background when the plugin is deactived
(#10085 ) (Sysix)
- c0e5251 language_server: Set `null` as a default value for
`configPath` (#10047 ) (Sysix)
- 09c0ac6 linter: Improve `unicorn/filename-case` (#10117 ) (shulaoda)
- d8e49a1 linter: Compute lintable extensions at compile time (#10090 )
(camchenry)
- b3ec235 linter: Use items of `oxc_ast::ast` module directly (#10100 )
(Ulrich Stark 🦀 )
- 93e6c0b linter: Use `FormalParameter::has_modifier` to detect
parameter properties (#10097 ) (Ulrich Stark 🦀 )
- 5d829c2 semantic: Align handling of declaring symbol for function with
TypeScript (#10086 ) (Dunqing)
### Testing
- 410b8d6 editor: Use debug build of the language server (#10083 )
(Sysix)
- 500add0 editor: Add test for `oxc.fixAll` command (#10045 ) (Sysix)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-04-01 14:20:49 +08:00
camchenry
d8e49a15d9
refactor(linter): compute lintable extensions at compile time ( #10090 )
...
Previously, we were wasting some time creating a `Vec` at runtime with the lintable extensions, which is all of the JS/TS extensions plus other frameworks extensions like `.vue`. Now, we precompute this as a static string slice at compile time. This also ensures that we are using the same extensions list between `oxlint` and the language server too. Theoretically this is a very minor perf win possibly?
2025-03-29 12:38:23 +00:00
Dunqing
370266cab6
feat(semantic): check redeclaration of variable declaration and function declaration in the block scope ( #10074 )
...
close : #10050
close : #10051
close : #10055
close : #10056
This PR causes a lot of test262 tests to fail, all are expected. The reason is that the test262 test runner has a little incorrect, see #10057 . And also produces a lot of duplicate errors, which will be removed in #10078 .
2025-03-28 07:32:24 +00:00
camchenry
2c808580d8
fix(linter): enable multi-file analysis for nested configs ( #10089 )
...
- fixes #10054
previously, multi-file analysis was only enabled when the root `.oxlintrc.json` contained the import plugin. now, we enable if any `.oxlintrc.json` has the import plugin.
2025-03-28 05:49:22 +00:00
oxc-bot
b1a30d6d72
release(oxlint): v0.16.3 ( #10030 )
2025-03-25 16:34:15 +08:00
Boshen
6432707052
refactor(rust): use lazy-regex ( #10004 )
2025-03-24 08:03:00 +00:00
oxc-bot
930cc8bb16
release(oxlint): v0.16.2 ( #9935 )
...
## [0.16.2] - 2025-03-21
- bfb416c editor: [**BREAKING**] Enable nested configuration by default
(#9929 ) (Sysix)
### Bug Fixes
- 2e8198e linter: Skip extending config files that look like named
configs or not files (#9932 ) (camchenry)
- f649fb3 linter: Reclassify `unicorn/no-document-cookie` as restriction
(#9933 ) (camchenry)
### Documentation
- 46a12c6 linter: Tell about junit `--format` options (#9931 ) (Sysix)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-03-21 13:33:54 +08:00
camchenry
f649fb3d44
fix(linter): reclassify unicorn/no-document-cookie as restriction ( #9933 )
...
- closes https://github.com/oxc-project/oxc/issues/9927
I think for a default rule this one can be a little bit niche. I don't think it's a best practice for sure. This would be a great rule to include if we started supporting opt-in named configs like "recommended" and such.
2025-03-21 03:32:04 +00:00
Sysix
46a12c673c
docs(linter): tell about junit --format options ( #9931 )
2025-03-21 02:44:25 +00:00
oxc-bot
1c3204723a
release(oxlint): v0.16.1 ( #9903 )
2025-03-20 13:03:09 +08:00
1zumii
8e3d9be3c3
feat(linter): support --report-unused-disable-directive ( #9223 )
...
and `--report-unused-disable-directives-severity`
closed #7544
---------
Co-authored-by: Boshen <boshenc@gmail.com >
2025-03-19 19:34:25 +08:00
Ulrich Stark
e6f7c74ee2
fix(linter): import and fix tests for typescript::no_unnecessary_parameter_property_assignment ( #9720 )
...
Followup to #9618 .
PRs for oxc/no-redundant-constructor-init: #9299 #9364
typescript-eslint rule:
[Docs](https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment )
[Source](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/no-unnecessary-parameter-property-assignment.ts )
[Tests](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/tests/rules/no-unnecessary-parameter-property-assignment.test.ts )
Changes of this PR:
- Imported tests from typescript-eslint
- Added one more passing test to the end
- Fixed all new test cases
- Changed rule category back to correctness
This is my first major change to OXC.
If there's anything wrong or not the OXC-way, I will happily improve on
that.
2025-03-17 18:36:09 +08:00
Boshen
b34cf94c9b
refactor(oxlint): remove jemallocator ( #9823 )
...
jemallocator is inactively maintained. mimalloc is slightly faster on all platforms.
This should also improve cold compile time for this project.
The only downside of mimalloc is that it requires `cmake`.
2025-03-17 09:19:55 +00:00
LongYinan
84fa5389a3
perf(minify): use mimalloc-safe to replace mimalloc ( #9810 )
...
This is maintained by us, and it's upgraded to mimalloc 2.2.2. This pr
also adds mimalloc to `oxc-minify`
2025-03-17 12:38:01 +08:00
oxc-bot
fef680a477
release(oxlint): v0.16.0 ( #9800 )
...
## [0.16.0] - 2025-03-16
- 225e266 linter: [**BREAKING**] Enable `--experimental-nested-config`
by default and add `--disable-nested-config` option (#9760 ) (camchenry)
### Features
- 27d6e9b editor: Only watch .oxlintrc.json or user supplied config
paths (#9731 ) (Nicholas Rayburn)
- 8dd6809 linter: Add `eslint/no-lonely-if` (#9660 ) (therewillbecode)
- c22276e oxc_linter: Sort rules by plugin and rule name when outputting
resolved config as a JSON string (#9799 ) (Nicholas Rayburn)
### Bug Fixes
- 22f18ac linter: Improve `jsx-a11y/anchor-ambiguous-text` diagnostic
message (#9789 ) (1zumii)
- 6c11740 linter: False positive in `unicorn/catch-error-name` (#9763 )
(shulaoda)
### Documentation
- ea6b6d9 linter: Improve docs for `eslint-valid-typeof` (#9797 )
(therewillbecode)
- 2c48fba linter: Fix typo in `oxc/bad-min-max-func` (#9791 ) (Flo)
- 210b876 linter: Improve `eslint-no-async-promise-executor` (#9778 )
(therewillbecode)
- f8628bc linter: Improve `eslint-no-class-assign` (#9779 )
(therewillbecode)
- faca7a8 linter: Improve `eslint-no-self-assign` (#9768 )
(therewillbecode)
### Refactor
- 227d203 linter: Improve `typescript-no-unnecessary-type-constraint`
(#9798 ) (therewillbecode)
- 05fe2cd linter: Use `is_lexical` when checking for lexical decl
(#9781 ) (camc314)
- fcdd810 linter: Remove if let nesting from `unicorn-no-date-clone`
(#9767 ) (therewillbecode)
- 5a9e1b9 linter: Improve `typescript-no-misused-new` (#9766 )
(therewillbecode)
- 9df5565 linter: Improve `unicorn/filename-case` (#9762 ) (shulaoda)
- b0b1f18 linter: Remove if let nesting from
`nextjs-no-async-client-component` (#9764 ) (therewillbecode)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-03-16 10:22:09 +08:00
1zumii
22f18ac144
fix(linter): improve jsx-a11y/anchor-ambiguous-text diagnostic message ( #9789 )
...
fix #9787
2025-03-14 15:54:46 -04:00
camchenry
225e2666b0
feat(linter)!: enable --experimental-nested-config by default and add --disable-nested-config option ( #9760 )
...
- closes https://github.com/oxc-project/oxc/issues/9755
- Makes the `--experimental-nested-config` behavior the default.
- Includes a bug fix where nested configs didn't work properly with `--fix`.
- Adds a `--disable-nested-config` option to just read the config file from the current directory and skip looking for `.oxlintrc.json` files in directories.
2025-03-13 15:50:50 +00:00
oxc-bot
b5f8222027
release(oxlint): v0.15.15 ( #9726 )
...
## [0.15.15] - 2025-03-12
### Features
- 2ddad59 linter: Add unicorn/require-post-message-target-origin rule
(#9684 ) (yefan)
- 474a57b linter: A new multi-file analysis runtime (#9383 ) (branchseer)
### Bug Fixes
- 6c0978b linter: No-single-promise-in-promise-methods: do not fix
Promise.all when chained (#9697 ) (camchenry)
- ab594f1 linter: Turn oxc/no-redundant-constructor-init into
typescript/no-unnecessary-parameter-property-assignment (#9618 ) (Uli)
- 91c009a linter: Add missing fail cases in
`eslint-no-array-constructor` (#9659 ) (therewillbecode)
- 2810e5b linter: Add missing fail cases in eslint/no-self-compare
(#9693 ) (therewillbecode)
### Refactor
- b9ab60b linter: Remove if let nesting from `bad-min-max-function`
(#9722 ) (therewillbecode)
- 90b0227 linter: Remove if let nesting from
`eslint-operator-assignment` (#9721 ) (therewillbecode)
- 5ef578e linter: Improve `jest/no-alias-methods` (#9694 )
(therewillbecode)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-03-13 07:51:46 +08:00
Uli
ab594f1bc5
fix(linter): turn oxc/no-redundant-constructor-init into typescript/no-unnecessary-parameter-property-assignment ( #9618 )
...
Closes #9599
I switched the category to nursery because in a followup PR I will
import all tests from typescript-eslint and attempt to fix all of them.
This separation into two PRs makes the changes easier to review and
preserves the history and original author of the lint rule.
2025-03-12 15:14:13 +08:00
branchseer
474a57b140
feat(linter): a new multi-file analysis runtime ( #9383 )
...
fixes #9077 , #7996 , #8631 .
## Results of running `oxlint -c oxlint.json` on
AFFiNE@[97cc814a](https://github.com/toeverything/AFFiNE/tree/97cc814a2211b07160e3d0f02f3e2d967e8e970f )
**1.3x** slower, takes **0.86x** memory.
### Before
```
$ /usr/bin/time -al ../oxc/target/release/oxlint_main -c oxlint.json
[lint error messages omitted]
Found 0 warnings and 3 errors.
Finished in 588ms on 4990 files with 135 rules using 10 threads.
0.61 real 3.69 user 0.94 sys
402784256 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
31315 page reclaims
0 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
0 signals received
2 voluntary context switches
6127 involuntary context switches
42060793125 instructions retired
13307821784 cycles elapsed
398427968 peak memory footprint
```
### After
```
$ /usr/bin/time -al ../oxc/target/release/oxlint -c oxlint.json
[lint error messages omitted]
Found 0 warnings and 6 errors.
Finished in 764ms on 4990 files with 135 rules using 10 threads.
0.77 real 4.07 user 1.49 sys
348061696 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
31412 page reclaims
0 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
0 signals received
5 voluntary context switches
6625 involuntary context switches
44886241869 instructions retired
15977031204 cycles elapsed
343606976 peak memory footprint
```
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com >
2025-03-11 18:13:47 +08:00
oxc-bot
75d33e83e8
release(oxlint): v0.15.14 ( #9681 )
...
## [0.15.14] - 2025-03-11
### Features
- 0815fe8 linter: Add `promise/no-return-wrap` (#9537 ) (therewillbecode)
- ae7bb75 linter: Add react/jsx-filename-extension rule (#9474 ) (Cédric
DIRAND)
- 50327f3 linter: Add import/exports-last (#9578 ) (yefan)
- 75e4b8d linter: Add import/no-anonymous-default-export rule (#9481 )
(yefan)
- 2f08b16 linter: Add `promise/prefer-catch` (#9488 ) (therewillbecode)
- 41f32ea linter: Allow adding more overrides via `extends` configs
(#9475 ) (camchenry)
- fb7cf10 linter: Allowing `plugins` to be extended with `extends`
(#9473 ) (camchenry)
- fc74849 linter: Inherit `rules` via the extended config files (#9308 )
(camchenry)
- 3fce826 linter: Add support for `extends` property in oxlintrc (#9217 )
(camchenry)
### Bug Fixes
- 2d42569 linter: Rule `eslint/no-unsafe-optional-chaining` (#9632 )
(therewillbecode)
- a9d7df9 linter: False positive in `unicorn/escape-case` (#9638 )
(shulaoda)
- 3831819 linter: Fix example lint declaration and macro syntax (#9626 )
(Uli)
- 4ca62ab linter: Output right file line and column for `.vue`, `.astro`
and `.svelte` files (#9484 ) (Sysix)
- 3105159 linter: Do not output number of rules with nested configs
(#9476 ) (camchenry)
- 5ecda01 linter: Support nested extending (#9472 ) (camchenry)
### Documentation
- b7c61e9 linter: Improve docs for `eslint-guard-for-in` (#9658 )
(therewillbecode)
- 1cc43f7 linter: Improve the documentation of `eslint-no-console`
(#9612 ) (therewillbecode)
- 608bb77 linter: Improve the docs and add test case for
`typescript-no-extra-non-null-assertion` (#9609 ) (therewillbecode)
- 43add5d linter: Better docs for
`typescript-no-non-null-asserted-nullish-coalescing` rule (#9610 )
(therewillbecode)
- bd90ce6 linter: Improve the docs and add test cases for
`eslint-no-shadow-restricted-names` (#9597 ) (therewillbecode)
- a0c9f7c linter: Improve the documentation of `eslint-no-func-assign`
(#9596 ) (therewillbecode)
- ec922e9 linter: Improve the documentation of
`typescript-consistent-type-definitions` (#9575 ) (therewillbecode)
- 165c89d linter: Improve the documentation of `typescript-no-namespace`
(#9545 ) (therewillbecode)
### Refactor
- c174600 linter: Improve `eslint/no-duplicate-imports` (#9627 )
(therewillbecode)
- 31ba425 linter: Improve `eslint/no-self-assign` (#9635 )
(therewillbecode)
- 03a40df linter: Access scoping from `ctx` directly (#9624 ) (Boshen)
- be5e5dc linter: Improve `unicorn/escape-case` (#9568 ) (shulaoda)
- b7f82fc linter: Improve `unicorn/error-message` (#9560 ) (shulaoda)
- 069ef2d linter: Improve `promise/no-nesting` (#9544 ) (therewillbecode)
- 62bffed rust: Allow a few annoying clippy rules (#9588 ) (Boshen)
### Testing
- 934a387 linter: Remove test dependency on oxlint (#9513 ) (camchenry)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-03-11 16:07:11 +08:00