100 Commits
Author SHA1 Message Date
Sysix b5b3f3fc88 fix(linter/eslint/no-misleading-character-class): detect more combining characters (#28733)
fixes https://github.com/oxc-project/oxc/issues/28729

Generated by Claude Sonnet 5.5 🤖

The upstream rules uses regex to detect if it is a combining character with the `\p` shorthand:
https://github.com/eslint/eslint/blob/main/lib/rules/utils/unicode/is-combining-character.js#L11

Because there is no similar utility in rust, we currently have a self-managed list of character detection.
This list now get extended to detect more characters for other languages like Arabic, Hebrew, Thai ...

Verified manually that the failing test cases also fails upstream.
Did not verfify if the list is really valid and covers all possible combining characters.
I hope that the AI did no mistakes and included characters which are still valid.
2026-11-03 09:47:30 +00:00
Sysix cf34678cd6 feat(oxlint): export Oxlintrc type (#28132)
Exporting the `Oxlintrc` type with all expected values (including `$schema` and the json form of `extends`).
The background is that the `eslint-plugin-oxlint` package currently needs to rebuild this type manually.

https://github.com/oxc-project/eslint-plugin-oxlint/blob/b41a301a79d4684effb3297e5b0e196c2bb48f06/src/build-from-oxlint-config/types.ts#L26-L35

Instead of rebuilding  `Oxlintrc` by hand, I would prefer to import the original JSON-Struct from `oxlint` itself.
2026-10-23 18:20:00 +00:00
Sysix f61ae9ab42 fix(lsp): return default diagnostic report when server is not in pull mode (#27745)
Addresses one problem in #27736.
Clients should respect the the `ServerCapabilities` from the `intialize` response.
When no `diagnosticProvider` is provided, the server says to the client that `textDocument/diagnostic` is not supported.

```
        /**
	 * The server has support for pull model diagnostics.
	 *
	 * @since 3.17.0
	 */
	diagnosticProvider?: DiagnosticOptions | DiagnosticRegistrationOptions;
```
_https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#pull-diagnostics_

Sadly the client does not need to respect them and can requzest `textDocument/diagnostic` even if we told him not to do.
To avoid duplicate linting processes on push mode (server is sending diagnostics to the client on `didOpen/didChange`, we check if we are in the right mode, or else bail out earlier.
2026-10-23 15:16:02 +00:00
Sysix a6e882660d test(oxfmt/lsp): normalize error path for windows (#27465)
Fixes the newly failing LSP tests.
https://github.com/oxc-project/oxc/actions/runs/37825484255/job/113477127715

Comes from the stack of https://github.com/oxc-project/oxc/pull/26014.
Skipping the failing symlink CLI test

Resulting Job: https://github.com/oxc-project/oxc/actions/runs/37841727502/job/113532492164?pr=27465
2026-10-09 01:15:49 +00:00
Sysix 77f8156f08 feat(oxfmt/lsp): show root config errors to LSP client (#26014)
## Summary
This PR improves the oxfmt LSP server's error reporting by propagating root configuration resolution errors to the language server client as notification messages. Previously, configuration errors were only logged via `warn!` macros, making them invisible to users in their editors.

## Problem
When the oxfmt LSP server encountered configuration errors (e.g., invalid `.oxfmtrc.json`, missing required files), these errors were silently logged on the server side. Users had no visibility into why formatting wasn't working or configuration wasn't being applied, resulting in poor debugging experience.

## Solution
The PR modifies the configuration loading pipeline to:
1. Capture configuration errors as `ClientMessage` structs containing the error message and message type
2. Propagate these messages through the `ServerFormatterBuilder` and `ServerFormatter::new()` initialization flow
3. Return collected messages alongside the formatter instance
4. Display these messages to the client via LSP `ShowMessage` notifications during initialization and on config changes

_PR description generated by AI 🤖_
2026-10-08 18:28:34 +00:00
Sysix 5dae56f577 fix(oxfmt/lsp): return error on config resolving error (#26003)
Instead of silently ignoring config-resolve errors, and not formatting the document,
`oxfmt --lsp` now returns an `Err` instead, allowing users to see on their LSP client a meaningful message.

Hitting Format on a file, could produce a `toast` like in this following example:
<img width="463" height="173" alt="grafik" src="https://github.com/user-attachments/assets/7d549ab1-b65b-41bc-9fa0-f5f9d10989dc" />
2026-10-08 18:28:34 +00:00
Sysix 316bf847f8 refactor(oxlint/lsp): send trace messages on backend side (#26002)
It is always a good idea to send the message the `stderr` channel too, because the client can filter a stack of messages out (like VSCode does).
Instead of having the responsibility on `oxfmt` and `oxlint`, we can now move logic to the `Backend`.
2026-10-08 16:39:57 +00:00
Sysix bde9f699e7 feat(oxlint/lsp): show config errors to LSP client (#25486)
Surface Oxlint configuration failures to LSP clients as `window/showMessage` notifications during workspace initialization.
Report root, nested, and custom-config-path loading/build failures to the client while preserving fallback linting behavior.

VSCode only show a max of 5 messages from a short time, but with #25962 we already reduce the communication to a maximum of 5 messages.

Here is a screenshot of the `oxc` project where no `oxc.configPath` is defined in the VSCode setting (loading all our fixtures configs)

<img width="459" height="581" alt="grafik" src="https://github.com/user-attachments/assets/9a39e5b7-b049-414b-a487-16a505eb278b" />
2026-10-08 15:40:24 +00:00
Sysix 011c504d19 chore(lsp): use futures-util crate instead of futures (#26590)
Coming from https://github.com/tower-lsp-community/tower-lsp-server/pull/78.
The final result build size is the same for linux-x64-gnu.
2026-09-21 16:29:52 +00:00
Sysix 583e4318bf chore(lsp): update tower-lsp-server to 0.24.0-rc.1 (#26574)
This is a (draft) PR for the upcoming `tower-lsp-server` version.
The new version has many breaking changes like:
- [switching to `gen-lsp-type`](https://github.com/tower-lsp-community/tower-lsp-server/commit/d8aae8255284b76f90f7617e7faae8a9cd5f39eb)
- [removed the `UriExt`](https://github.com/tower-lsp-community/tower-lsp-server/commit/27c0cae9229a83168be3f273d22b51acd2194982)

## Changes
- Updates all Imports & Structs/Enum values to `gen_lsp_type`
- I copied the helper functions from the old `UriExt` into a `oxc_language_server`.
https://github.com/tower-lsp-community/ls-types/blob/a6feea6c723b3314d80c69e66b452978f62f6afb/src/uri.rs
2026-09-21 16:29:51 +00:00
Sysix 432f7606c8 test(lsp): add test for non-blocking requests (#23694)
Related: https://github.com/oxc-project/oxc-vscode/pull/310#issuecomment-4762272418

Adds a regression test for code-action requests being blocked by slow pull diagnostics, which can delay code actions on save when `tsgolint` takes longer to finish. The test sends five diagnostic requests with a 100 ms delay each, followed by a code-action request, and checks that the code action returns before all five diagnostic delays elapse.

The test remains ignored because it still reproduces the blocking behavior on the current base: 525 ms elapsed against a 500 ms limit. All 102 active language-server tests pass. Formatting and the workspace compile check pass; `just ready` stops at formatter conformance because DNS access prevents downloading the Prettier suite.

AI assistance was used to resolve rebase conflicts and update this description.
2026-09-16 07:26:36 +00:00
Sysix ec5038890b fix(lsp): initialized: only run once diagnostic for known URIs (#26363)
When multiple workspaces did not get started on `initialize` (because the client did not send `initizialzeOptions`), the language server did iterate over each worker + each known URI.
Fixed the code so the `known_uris` are only iterate once.
2026-09-15 17:47:06 +00:00
Sysix 72bc7f2fa1 fix(oxlint): replace backlashes path for "no js runtime" diagnostic (#26599)
On Windows this diagnostic snapshot differs because of different path separators.
Replacing the backlashes to forward slashes, like oxlint does it already on different other diagnostics.

Found in main like this failed Job: https://github.com/oxc-project/oxc/actions/runs/34741295996/job/103681323798
Introduced by https://github.com/oxc-project/oxc/pull/26588
2026-09-13 22:12:10 +00:00
Sysix 5a52c8d53d test(oxlint/lsp): avoid calling run_file (#26353)
`run_file` is an internal function, which does not get called by the language server.
Instead, it calls the parent function `run_diagnostic`. Refactor the code, so internal implication is kept secret in tests.
2026-09-06 15:08:44 +00:00
Sysix a5a4ac8811 refactor(lsp): ToolTrait consume TextDocument & CodeActionParams (#26339)
Refactors the `oxc_language_server::Tool` trait and associated LSP plumbing to pass `TextDocument` and `CodeActionParams` by value, aligning tool APIs with “consume” semantics and simplifying call sites that previously had to keep borrowed values alive.
2026-09-05 18:33:58 +00:00
Sysix ca7104f775 refactor(lsp): dont create temporary map in collect_diagnostics_with (#26341)
<summary>Pull request overview</summary>

This PR refactors the language server’s `WorkspaceWorker::collect_diagnostics_with` to avoid building an intermediate map when collecting tool diagnostics, returning the tool’s `DiagnosticResult` directly.

This was an old code path when `oxc_language_server` did used both tools (`oxlint` & `oxfmt`) at the same time
2026-09-04 21:36:42 +00:00
Sysix 3b7e45399d refactor(oxlint/lsp): remove offset_to_position (#26336)
With https://github.com/oxc-project/oxc/pull/23329 the conversion from offset to line/column position is now done by a helper function in `oxc_language_server`.
There was a helper function inside `oxlint` to call the function. Instead, call it directly now.
Moved the tests to the correct place, and removed duplicated ones.
2026-09-04 14:00:48 +00:00
Sysix 2a68cc458b refactor(oxlint/lsp): remove Option for code actions map (#26335)
The `Option<>` wrap for `Vec<LinterCodeAction>` is not needed, after each lint-run we save an entry (even if empty) to the map.
There is no different code branch for `None` as a value.
2026-09-04 13:31:46 +00:00
Sysix 9cee146886 fix(oxlint/lsp): don't try to parse fix message, always fallback (#26204)
We had at the beginning some rules' diagnostics like `<rule-name>: diagnostic message`, from that message we did create a code action `Fix this <rule-name> problem`, but this is buggy.
I searched in `crates/oxc_linter` for `OxcDiagnostic::\w+\(".*:` and found only `no-invalid-regexp` to be a useful case.
For other rules this could be wrong like:
- Unexpected `javascript:` url
- `<Document />` from `next/document` should not be imported outside of `pages/_document.js`. See: https:/..`
- Always prefer `const x: T = { ... }`.
2026-09-02 19:28:32 +00:00
Sysix 9e1b635d34 refactor(oxlint/lsp): delay String Conversion for FixedContent to CodeAction properties (#26176)
**Before:**
Converting `Fix` to `FixContent` did convert `Cow` into `String` and stored into the `ServerLinter.code_action` Map, to get requested later by the client, where we convert `FixContent` to `CodeAction` (where we need the `String` format)

**After:**
Consume directly `Fix` `Cow` fields, and delay to conversion to `String` until the `CodeAction` is requested to be converted.
So only downside I see, is that `textDocument/codeAction` is requested more times than a `textDocument/diagnostic` request. So the conversion does happen more times, but get released quickly.
2026-09-01 08:09:29 +00:00
Sysix 8af5703b56 chore(oxlint/generate-config-types): remove unneeded DummyRule tsType mapping (#26206)
With the major update in https://github.com/oxc-project/oxc/pull/26193, this code does not do anything.
Removing it.
2026-08-31 19:28:43 +00:00
Sysix 0e969e8520 docs(lsp): update LanguageId docs to target the file extension first (#26068)
Updated the `LanguageId` docs, to reflect how the real implementation works.
We did a "rollback" to check for the file extension first, to align with the CLI.
This was specially a problem for jsonc LanguageId with json file extension, where a trailing comma was always added by the editor.

Related https://github.com/oxc-project/oxc/issues/25893
2026-08-24 16:37:20 +00:00
Sysix 288f9a5188 refactor(lsp): reduce client messages to the client to a max of 5 (#25962)
> ## Pull request overview
>
> This PR refactors the language server’s client-notification flow to avoid flooding editors with too many `window/showMessage` notifications by capping the number of messages sent in a batch to 5.
>

Test generated with GPT-5.3-Codex 🤖
2026-08-22 14:06:19 +00:00
Sysix 7e2f193dc2 refactor(lsp): allow tools to send multiple ClientMessages (#25961)
> ## Pull request overview
>
> Refactors the language-server tool initialization/restart plumbing to support emitting multiple `ClientMessage`s (instead of a single optional message), so tools can surface more than one warning/error to the client during startup and config changes.
>
2026-08-22 10:17:51 +00:00
Sysix a2619a9d78 refactor(lsp): show ClientMessage on dynamic worker creation (#25407)
> ## Pull request overview
>
> This PR updates the language server’s dynamic worker startup paths to surface `ClientMessage` warnings/errors to the client when a worker is created/started dynamically, and adds a regression test for single-file mode.
>
2026-08-09 12:02:18 +00:00
Sysix 2eb3916a45 fix(lsp): remove capability check for window/showMessage notification (#25402)
The `window/showMessage` notification is a baseline feature in LSP and does not need Client capability `window.showMessage`. This capability is only needed for the `window/showMessageRequest` request.

- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessage
- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessageRequest
2026-08-08 23:51:33 +00:00
Sysix 273d8675ac perf(linter): avoid diagnostic sorting after applying fixes (#25079)
`oxlint --fix` already presorts the messages by it `fixes` spans, before applying it into the source text.
Resorting the unapplied diagnostics after the operation is only useful for display usages.
I thought maybe the suppression manager needs the right order, but AI🤖 did scan the project is answered the following:

> So the line at mod.rs:413 is mainly for deterministic, source-order diagnostics after fixing. It is not required for correctness of applying fixes, but it is needed for stable and intuitive reporting order.

> Yes, for that specific final sort you highlighted, you can skip it if your only concern is suppression-file correctness.

> Why this is safe:

> Suppression counting is order-independent because it just increments counts by rule key while iterating messages: diff.rs:90.
Runtime suppression aggregation is also additive by rule and filename, not positional: mod.rs:30.
Suppression file output is deterministically sorted at serialization time (BTreeMap), independent of incoming message order: tracking.rs:35.
Important caveat:

> Keep the earlier sort used before applying fixes, since fix application logic depends on processing by fix span: mod.rs:364.
Only the final sort of filtered messages is optional for your case: mod.rs:413.
2026-08-07 10:15:30 +00:00
Sysix 4ec9189b26 perf(oxlint/lsp): avoid second lock for getting/removing unused directives (#25350)
Avoids a second lock for `.map` inside `DirectivesStore` when consuming the directives on `--lsp` side.
2026-08-07 10:00:46 +00:00
Sysix 6c0d01b8de perf(oxlint/lsp): preallocate fix-content vec (#25351)
After https://github.com/oxc-project/oxc/pull/24958 we know the size of `Vec<FixedContent>` , because we are only consuming now `Messages.fixes` which are directly mapped into `FixedContent`
2026-08-07 09:45:27 +00:00
Sysix 884d6b060f refactor(linter): remove Message.fixed (#25040)
> ## Pull request overview
>
> This PR refactors the linter’s fixer diagnostics plumbing by removing the unused `fixed` state from `fixer::Message`, relying instead on the existing behavior where `Fixer::fix()` returns only the messages that were _not_ applied.
>
> **Changes:**
>
>     * Remove `fixed: bool` from `Message` and simplify `Message::new` accordingly.
>
>     * Simplify the fix-application loop by no longer mutating `Message` instances solely to toggle `fixed`.
2026-07-29 11:13:26 +00:00
Sysix 31fb4c1508 refactor(linter): remove MessageRule (#25031)
This struct was introduced by Bulk-Suppressions (https://github.com/oxc-project/oxc/pull/19328).
`OxcDiagnostic` already contains `OxcCode` with the relevant information.

Downside: The `oxc_parser` diagnostics can be included now in the suppression file.
2026-07-29 10:56:30 +00:00
Sysix 6d758fdc4f refactor(linter): remove Message.section_offset property (#25030)
With moving the ignore logic into `oxc_linter`, nobody is now interested in `Message.section_offset`.
The last PR https://github.com/oxc-project/oxc/pull/24958 did remove the last/only dependency of this property.
2026-07-29 10:25:32 +00:00
Sysix 2ff0ccc594 refactor(oxlint/linter/lsp): extend "ignore fixes" on diagnostic creation (#24958)
This PR refactors the "ignore fixes" code, to be created on diagnostic creation.
With an extra flag in `LintOptions` and `LintRunner`, the caller can include automatically the fix for ignoring the diagnostic.
This flag is only enabled on `oxlint --lsp` side and is not effected by normal CLI usage.

Important changes:
- The "fixes" are working now with `Spans` instead of `Position`
- The calculation of the right span is not depending on the partial source text, instead of the full source text
- new `FixKind` for the `ignore` fixes.

Generated by GPT-5.3-Codex 🤖 Reviewed by myself
2026-07-29 10:17:49 +00:00
Sysix 7807304a70 refactor(oxlint/linter/lsp): move ignore logic to oxc_linter (#24951)
The start for fixing https://github.com/oxc-project/oxc/issues/24570

At the moment the "ignore this line" / "ignore this section" logic is living inside `oxlint/lsp` directory.
Because we now need to know the AST parents, the code should live inside `oxc_linter`.

This PR refactors the 2 methods into a new `oxc_linter` file.
2026-07-29 09:40:58 +00:00
Sysix 74b5b484c2 test(lsp): add response buffer (#24086)
Working on the stack https://github.com/oxc-project/oxc/pull/23768 I created a local test with many responses in a quick time. This code change did resolve the issue.

Auto-merge because it only effects tests, even if not perfect :)

Autogenerated by Codex AI Agent 🤖
2026-07-26 15:20:27 +00:00
Sysix 5ba68796c9 refactor(oxlint/lsp): lint tsgolint in the same thread (#24670)
This PR comes from different use cases, and I hope I did not have a wrong understanding about spawning child.

### `std::spawn` in `tokio` runtime

Because the LSP is in a `tokio` runtime, we should avoid spawning threads with `std`, instead using `tokio::spawn`.
I try to work already with `tokio::spawn` in the `oxc_language_server` side with #23768
So this will spawn the complete diagnostic path into one separate process. We already need to wait for the `tsgolint` result, so spawning one thread there is suboptimal(?)

### `disable_directives_map` lock for the whole thread spawn

Asked Codex Terra 5.6 where a lock could be generated in #23768, and it found this long-lock.

> The problematic lock scope is tsgolint.rs line 403: the stdout-reader takes disable_directives_map.lock() before iterating the entire TsGoLintMessageStream. The diagnostic reader therefore serializes all type-aware runs, including code actions. This is especially visible after introducing concurrent diagnostics.

### tsgolint process still running

Some users did report that many tsgolint processes are still running, even if not typed. My first guess is these are zombie processes and can be safely killed.
I did not find the exact issue but https://github.com/oxc-project/oxc-vscode/issues/264 should be good enough for a reference.
2026-07-22 15:34:51 +00:00
Sysix 7be5cf08f3 perf(oxlint/lsp): only invoke lint on code actions when document is not opened (#24676)
Some clients can send code actions for documents, which are not opened and already analyzed with a lint process.
A good example is the IntelliJ plugin, which allows the "fix all" code action from the file explorer.

> This PR refactors the language-server → tool code-action API to pass a single request struct (including an “is document open” flag), enabling the oxlint LSP linter to avoid re-running lint for code-action requests when the document is already open (and presumably already linted/cached).

This is mostly needed for https://github.com/oxc-project/oxc/pull/23768
2026-07-19 17:16:22 +00:00
Sysix d86f60b61c fix(lsp): normalize user config path to watch pattern (#23723)
When a user defined a custom config path, like `fmt.configPath` or `configPath`, the watch pattern returned the same path.
VS Code does not respect this as a valid pattern and does not watch for files defined like `./define-config.ts`.
Resulting into an LSP client, which will not send a watched-file-change requests to the server, when the user edited an important config path.
2026-06-25 00:15:37 +00:00
Sysix 1c8f50c67f feat(linter): add schema for eslint/no-restricted-import (#23642) 2026-06-23 08:27:16 +00:00
Sysix ff65285157 feat(linter): no-restricted-globals add missing upstream options (#23663)
Closes https://github.com/oxc-project/oxc/issues/23617

Added the missing option `checkGlobalObject`, which detect globals, which are accessed by global object like `globalThis` or `window`.
`globalsObjects` option can extend the searching of globals.

Upstream implementation: https://github.com/eslint/eslint/pull/19939

Regenerated the tests with the just command.
Added some comments to skipped tests, explaining what is missing.

PS: this rule sounds like it can be resolved via `run_once` and the unresolved reference table. With the globals check like `window["foo"]`, `foo` is not longer a reference. Maybe someone has a great idea to run it only once
2026-06-21 17:27:39 +00:00
Sysix b1b83d5b9f refactor(linter): remove second | undefined from DummyRuleMap ts generation (#23684) 2026-06-21 13:54:06 +00:00
Sysix 0dc2405411 feat(linter): add schema for eslint/no-restricted-properties (#23619) 2026-06-20 20:38:31 +00:00
Sysix b638d0ee1d feat(linter): add schema for node/callback-return (#23615)
- Avoided looping over `array` of `array`, we only want to know the first level of structure for detecting a tuple config
- refactored some code and introduced a `.clone()` at the beginning. Hope this is fine for the rule doc code path. Feeling sometimes stupid without AI quick fixes :')
- enabled `node-callback-return` schema, which is the only rule that accepts a array as a config
  - https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
2026-06-20 20:38:31 +00:00
Sysix 6d355ab8b3 refactor(linter): remove number_as_object_schema helper (#23614)
The helper generated just `number`. With the `Enum` approach, the generator creates a `u32` with `minimum: 0.0` for the JSON schema.
2026-06-20 20:28:54 +00:00
Sysix de778ec3bf fix(linter): unicorn/numeric-separators-style preserve dot for floats without decial part (#23553)
Fixed the new failing test from upstream, after we implemented the new upstreams test in #23524.
Added more tests for some use-cases, which could fail when fixing. Everything looks good 👍
2026-06-18 11:08:29 +00:00
Sysix 953c7b3f1c refactor(linter): make unicorn/numeric-separators-style options u32 (#23558)
I hope we do not support 16bit systems 😅
Fixes the 32bit snapshot test:
https://github.com/oxc-project/oxc/actions/runs/27706245542/job/81955398728
2026-06-17 17:26:24 +00:00
Sysix 59d8893e54 feat(linter): unicorn/numeric-separators-style support missing options (#23524)
Closes https://github.com/oxc-project/oxc/issues/23383
Tests generated by upstream rule and our `just` script.
2026-06-17 11:17:29 +00:00
Sysix b08e9f5b9e refactor(linter): re-enable schema for jsx_a11y/no-noninteractive-element-interactions (#23522) 2026-06-17 10:15:19 +00:00
Sysix 0338b49476 refactor(linter): use strictIndexSignatures when generating TS config (#23521)
This PR enables `strictIndexSignatures` option when generating `oxlint` config type declarations, allowing us to implement rule config schemas where the generation would produce a TS error.
See https://github.com/oxc-project/oxc/issues/23299 for the problem.

The generated code now appends `undefined` for some rule config options.

The docs of the option:

```
    /**
     * Append all index signatures with `| undefined` so that they are strictly typed.
     *
     * This is required to be compatible with `strictNullChecks`.
     */
    strictIndexSignatures: boolean;
```
2026-06-17 10:02:46 +00:00
Sysix 37a34a128f fix(oxfmt/lsp): avoid newlines line ending changes (#23463)
close https://github.com/oxc-project/oxc/issues/23462
Manually tested in VS Code.
A snapshot test will not work, because it does not reflect how editors work, it just replaces position→bytes offset, not interpreting what an editor/ LSP client does.
_https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments_

> So you can not specify a position that denotes \r|\n or \n| where | represents the character offset.
2026-06-15 23:55:24 +00:00
Sysix fef29bdbce refactor(linter): add MixedTupleRuleConfig (#23396)
Added a new struct for 3 rules:
- `eslint/func-name-matching`
- `import/extension`
- `react/jsx-no-script-url`

These rules accept an enum configuration like:
```rust
enum ConfigOptions {
 First(Option1),
 Second(Option2),
 Both(Option1, Option2)
}
```

Added the new struct for `eslint/func-name-matching` to test if the expected result matches the upstream configuration.
Changed the rule schema generation code, so enums (`subschema with any_of`), will be folded, Allowing us to support the 3 rules.
2026-06-15 16:53:26 +00:00
Sysix 965358e613 refactor(linter): reuse RuleNoConfig reference for rule schema (#23390)
Because `RuleNoConfig` is already `AllowWarnDeny | [AllowWarnDeny]` we can reuse the reference for all other rules config and saving us some bytes on the TS config types generation.
2026-06-14 13:47:07 +00:00
Sysix a401de8a7b test(lsp): fix unused imports for non-unix platforms (#23399) 2026-06-14 11:59:06 +00:00
Sysix b0d39d7942 test(website): fix tests for win32 (#23398)
fixes the tests on main:
https://github.com/oxc-project/oxc/actions/runs/27479376607/job/81224340552

introduced in https://github.com/oxc-project/oxc/pull/23387
2026-06-14 11:59:06 +00:00
Sysix 49e5649653 test(website): don't snapshot on schema validation (#23387)
It sounds stupid to create a snapshot from an already existing file.
Works on https://github.com/oxc-project/oxc/issues/22955 showed they will always match.

The PR changes the tests so it just checks if the existing file matches the output, without snapshots.
2026-06-13 21:14:05 +00:00
Sysix 26ddac621e fix(linter): avoid config schema generation for jsx_a11y/no-noninteractive-element-interactions (#23385)
Fixes #23299 for now.
We can look later how and where we need to make changes.
2026-06-13 17:57:00 +00:00
Sysix 30c74ce6bf feat(linter): add schema for jsx_a11y/no-noninteractive-element-to-interactive-role (#23384)
+ little refactoring on the other rule, we want to know the defaults from the `Config` and not from the `Rule`.
2026-06-13 17:31:56 +00:00
Sysix 99a3c78913 docs(linter): add info for more skipped rule schemas (#23380)
Aligns how https://github.com/oxc-project/oxc/issues/22955 is described
2026-06-13 16:44:44 +00:00
Sysix 028a8117d3 feat(linter): add schema for jsx-a11y/media-has-caption (#23377) 2026-06-13 16:22:32 +00:00
Sysix b3b1038f38 feat(linter): add schema for jsx-a11y/label-has-associated-control (#23376) 2026-06-13 16:22:32 +00:00
Sysix ee3dd49e8b feat(linter): add schema for jsx-a11y/img-redundant-alt (#23374) 2026-06-13 15:54:30 +00:00
Sysix 40556ad8b5 fix(linter): parse jsx-a11y/control-has-associated-label config with DefaultRuleConfig (#23373)
- Used `DefaultRuleConfig` to parse the `serde_json` value
- Moved the 25 cap, to the `Deserializer`
- added schema validation + deny unknown fields
- removed test cases where the upstream rule auto-generated options for every rule
2026-06-13 15:30:37 +00:00
Sysix e3fd735e59 feat(linter): add schema for jsx_a11y/alt-text (#23369)
upstream docs: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md
2026-06-13 15:08:23 +00:00
Sysix f57b55db11 feat(linter): add schema for typescript/array-type (#23355) 2026-06-12 17:37:36 +00:00
Sysix 0dcf912b16 feat(linter): add schema for typescript/ban-ts-comment (#23354)
Requesting a little review, because the types are little bit complex.
Should be aligned with our tests and the upstream TS type:
https://typescript-eslint.io/rules/ban-ts-comment/#options
2026-06-12 17:26:26 +00:00
Sysix 59db0bd215 feat(linter): add schema for consistent-generic-constructors (#23353) 2026-06-12 15:07:59 +00:00
Sysix 2120ecfb45 docs(linter): describe problems on not verified rules schema (#23351) 2026-06-12 14:26:50 +00:00
Sysix c4775c01b5 feat(linter): add schema for typescript/consistent-type-assertions (#23349)
`assertionStyle` can only be `never` without any other options. This is currently not reflected within the schema.
Upstream docs:
https://typescript-eslint.io/rules/consistent-type-assertions/
2026-06-12 14:05:40 +00:00
Sysix 6e516f75b6 feat(linter): add schema for typescript/consistent-type-imports (#23348) 2026-06-12 14:05:40 +00:00
Sysix 44dbcc2f18 refactor(oxlint/lsp): remove unused Rope references (#23341)
With the changes from https://github.com/oxc-project/oxc/pull/23329, `Rope` does not need to be created and passed into the functions.
This PR removes all references to `Rope`, because we never access it.
2026-06-12 12:52:56 +00:00
Sysix 150bce13e4 feat(linter): add schema for typescript/no-empty-object-type (#23309) 2026-06-12 00:45:31 +00:00
Sysix f9e36f1738 feat(linter): add schema for typescript/no-duplicate-type-constituents (#23308) 2026-06-12 00:45:30 +00:00
Sysix 937accf58f feat(linter): add schema for typescript/no-invalid-void-type (#23307) 2026-06-11 23:58:30 +00:00
Sysix 3e042b9dbd feat(linter): add schema for typescript/no-misused-promises (#23306) 2026-06-11 23:58:30 +00:00
Sysix da212d1d1d feat(linter): add schema for typescript/no-unnecessary-condition (#23305)
The upstream rule has an option we do not to support:
```
    /** Whether to not error when running with a tsconfig that has strictNullChecks turned. */
    allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
```
https://typescript-eslint.io/rules/no-unnecessary-condition/
2026-06-11 23:45:58 +00:00
Sysix f8f0d38eb3 feat(linter): add schema for typescript/parameter-properties (#23304) 2026-06-11 22:41:24 +00:00
Sysix 2275fc7ec1 feat(linter): add schema for typescript/prefer-nullish-coalescing (#23302)
The upstream rules does support one more option, but I guess we do not want this:

```
    /** Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. */
    allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
```

https://typescript-eslint.io/rules/prefer-nullish-coalescing

Another little difference: The upstream rule marks as `true | IgnorePrimitivesOptions`, we support the `false` value too.
2026-06-11 22:20:24 +00:00
Sysix d353858d1c feat(linter): add schema for typescript/prefer-string-starts-ends-with (#23301)
Should we deprecate/remove the unicorn version of it?
https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-starts-ends-with

We marked some rules as unsupported because they should use the type-aware version. 🤔
2026-06-11 21:47:41 +00:00
Sysix 03060f5f06 feat(linter): add schema for typescript/triple-slash-reference (#23300)
Little review please because of the enum removal  🙇
#23301 has a question too.
2026-06-11 21:29:40 +00:00
Sysix 6619ceeffa feat(linter): add schema for promise/param-names (#23298) 2026-06-11 20:54:38 +00:00
Sysix 8bf108e2a1 feat(linter): add schema for promise/catch-or-return (#23297) 2026-06-11 20:40:14 +00:00
Sysix 48158d00b7 feat(linter): add schema for vitest/consistent-each-for (#23294) 2026-06-11 20:27:30 +00:00
Sysix 7e74c98794 feat(linter): add schema for vitest/consistent-test-filename (#23293) 2026-06-11 22:03:48 +02:00
Sysix ff94d4afa5 feat(linter): add schema for vitest/consistent-vitest-vi (#23292) 2026-06-11 19:42:29 +00:00
Sysix d8a5b57d7c refactor(linter): move vitest/consistent-each-for to style category (#23295)
> ```
> /// This rule enforces consistency in which method is used to create parameterized tests.
> /// This configuration affects different test function types (`test`, `it`, `describe`, `suite`).
> ///
> /// ### Why is this bad?
> ///
> /// Without a consistent way to create parameterized tests, we rely on the developer to remember that
> /// `.for` spreads the values as different arguments while `.each` passes the array as a single argument.
> ```

For me this sounds more like `style`, because both ways are valid.
2026-06-11 19:36:04 +00:00
Sysix 4c4c19c62f fix(linter): no-noninteractive-element-interactions fix default values (#23288)
### First Change
Changed the `Default` implementation from the `Rule` default, into the `Config` default.
When `oxc_linter` tries to create a default config, it would be empty, instead of prefilled with the preferred handlers.

This reflects in https://github.com/oxc-project/oxc/pull/23283 where the schema now correctly defaults into an array, instead of `null`.

### Second Change
Extended the default `handlers` to reflect the upstream rule here:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/8f75961d965e47afb88854d324bd32fafde7acfe/src/rules/no-noninteractive-element-interactions.js#L35-L40
and here:
https://github.com/jsx-eslint/jsx-ast-utils/blob/7cc40c4d2b88f221eae5ec2868754d31a85d8d71/src/eventHandlers.js
2026-06-11 19:30:18 +00:00
Sysix 2409a10364 feat(linter): add schema for vitest/prefer-import-in-mock (#23291) 2026-06-11 19:16:54 +00:00
Sysix e69b32171e refactor(linter): use u32 instead of usize for rule options (#23255)
Because `oxc_parser` skips every file with over `u32::MAX` bytes, every option in `oxc_linter` can be safely `u32` too.
Refactored all rules which accepts in some for `usize` into `u32`.
- Added clippy-expects with a simple description why the cast is safe.
- Updated the schema to reflect the changes

Generated By 🧠 and ✋
2026-06-10 20:45:09 +00:00
Sysix 127fb2c913 fix(linter): deserialize rule config with serde for unicorn/prefer-object-from-entries (#23253)
Using `DefaultRuleConfig` to parse the config and throw an error on invalid config values
\+ use `CompactStr` to store `functions` it option
2026-06-10 19:30:10 +00:00
Sysix 31543edec7 feat(linter): add schema for vue/define-props-destructuring (#23252) 2026-06-10 18:39:48 +00:00
Sysix 21b6c3d907 feat(linter): add schema for oxc/no-async-endpoint-handlers (#23251) 2026-06-10 18:13:56 +00:00
Sysix bcac2d6558 feat(linter): add schema for jest/vitest/no-restricted-matchers (#23247) 2026-06-10 17:37:49 +00:00
Sysix 539f036d19 feat(linter): add schema for jest/vitest/no-restricted-*-methods (#23246) 2026-06-10 17:37:49 +00:00
Sysix 3de589ab9b refactor(linter): jest/vitest/require-top-level-describe cap maxNumberOfTopLevelDescribes to u32::max (#23187)
fixes the bit32 tests:
https://github.com/oxc-project/oxc/actions/runs/27232854373/job/80417232773

I am not sure if this is the right solution, I expect that nobody tries that big of a number 🤷
2026-06-10 06:57:08 +00:00
Sysix 123d4f46be feat(linter): add schema for jest/vitest/valid-expect (#23185)
related https://github.com/oxc-project/oxc/issues/22955
2026-06-09 20:05:04 +00:00
Sysix 46c8a21d90 feat(linter): add schema for jest/vitest/require-top-level-describe (#23184)
related https://github.com/oxc-project/oxc/issues/22955
2026-06-09 20:05:04 +00:00
Sysix 41465cf77f feat(linter): add schema for jest/vitest/prefer-snapshot-hint (#23183)
related https://github.com/oxc-project/oxc/issues/22955
2026-06-09 19:09:54 +00:00
Sysix d068b9b6fd feat(linter): add schema for jest/vitest/prefer-expect-assertions (#23181)
related https://github.com/oxc-project/oxc/issues/22955
2026-06-09 19:09:54 +00:00
Sysix 064a1eede4 feat(linter): add schema for jest/prefer-ending-with-an-expect (#23180)
related https://github.com/oxc-project/oxc/issues/22955
2026-06-09 19:09:53 +00:00
Sysix d0467975f0 feat(linter): add schema for jest/vitest/no-standalone-expect (#23179)
related https://github.com/oxc-project/oxc/issues/22955?
2026-06-09 18:50:10 +00:00