mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
codex/comment-attachments
1128 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6a0e19cfaa |
feat(linter/eslint/no-unmodified-loop-condition): support checkConditionalExpressions option (#26249)
## Summary - add the ESLint-compatible `checkConditionalExpressions` option to `no-unmodified-loop-condition`, defaulting to `false` - port tests added by eslint/eslint#21175 and add regression coverage for repeated references within and across binary groups Closes #26182. |
||
|
|
34feccb479 |
fix(runtime): remove stale regenerator exports (#26243)
## Summary - remove the `@oxc-project/runtime/regenerator` export entries, which point to files that are not present in the package ## Details The runtime package was copied manually from `@babel/runtime`, while its legacy `regenerator/index.js` shim and dependency were intentionally omitted. Keeping the copied export entries advertised an API that has never resolved in a published Oxc runtime package. |
||
|
|
9a612d57e5 |
chore(deps): update npm packages (#26178)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [@typescript-eslint/parser](https://typescript-eslint.io/packages/parser) ([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)) | [`8.67.0` → `8.68.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/8.67.0/8.68.0) |  |  |  |  | | [@typescript-eslint/scope-manager](https://typescript-eslint.io/packages/scope-manager) ([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/scope-manager)) | [`8.67.0` → `8.68.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fscope-manager/8.67.0/8.68.0) |  |  |  |  | | [@typescript-eslint/visitor-keys](https://typescript-eslint.io) ([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/visitor-keys)) | [`8.67.0` → `8.68.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fvisitor-keys/8.67.0/8.68.0) |  |  |  |  | | [eslint](https://eslint.org) ([source](https://redirect.github.com/eslint/eslint)) | [`10.8.1` → `10.9.1`](https://renovatebot.com/diffs/npm/eslint/10.8.1/10.9.1) |  |  |  |  | | [svelte](https://svelte.dev) ([source](https://redirect.github.com/sveltejs/svelte/tree/HEAD/packages/svelte)) | [`5.56.10` → `5.57.0`](https://renovatebot.com/diffs/npm/svelte/5.56.10/5.57.0) |  |  |  |  | | [tinypool](https://redirect.github.com/tinylibs/tinypool) | [`2.1.0` → `2.1.2`](https://renovatebot.com/diffs/npm/tinypool/2.1.0/2.1.2) |  |  |  |  | | [vscode-languageserver-protocol](https://redirect.github.com/Microsoft/vscode-languageserver-node) ([source](https://redirect.github.com/Microsoft/vscode-languageserver-node/tree/HEAD/protocol)) | [`3.18.2` → `3.18.3`](https://renovatebot.com/diffs/npm/vscode-languageserver-protocol/3.18.2/3.18.3) |  |  |  |  | | [vscode-languageserver-textdocument](https://redirect.github.com/Microsoft/vscode-languageserver-node) ([source](https://redirect.github.com/Microsoft/vscode-languageserver-node/tree/HEAD/textDocument)) | [`1.0.12` → `1.0.14`](https://renovatebot.com/diffs/npm/vscode-languageserver-textdocument/1.0.12/1.0.14) |  |  |  |  | --- ### Release Notes <details> <summary>typescript-eslint/typescript-eslint (@​typescript-eslint/parser)</summary> ### [`v8.68.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#8680-2026-08-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.67.0...v8.68.0) This was a version bump only for parser to align it with other projects, there were no code changes. See [GitHub Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. </details> <details> <summary>typescript-eslint/typescript-eslint (@​typescript-eslint/scope-manager)</summary> ### [`v8.68.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/scope-manager/CHANGELOG.md#8680-2026-08-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.67.0...v8.68.0) This was a version bump only for scope-manager to align it with other projects, there were no code changes. See [GitHub Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. </details> <details> <summary>typescript-eslint/typescript-eslint (@​typescript-eslint/visitor-keys)</summary> ### [`v8.68.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/visitor-keys/CHANGELOG.md#8680-2026-08-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.67.0...v8.68.0) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. See [GitHub Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0) for more information. You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. </details> <details> <summary>eslint/eslint (eslint)</summary> ### [`v10.9.1`](https://redirect.github.com/eslint/eslint/compare/v10.9.0...5c8c2417b9ff462f2dc4e54a062c59135b45b845) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.9.0...v10.9.1) ### [`v10.9.0`](https://redirect.github.com/eslint/eslint/compare/v10.8.1...c27bc926e496985eb7911c09eb60914b2e4b5d0f) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.8.1...v10.9.0) </details> <details> <summary>sveltejs/svelte (svelte)</summary> ### [`v5.57.0`](https://redirect.github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570) [Compare Source](https://redirect.github.com/sveltejs/svelte/compare/svelte@5.56.10...svelte@5.57.0) ##### Minor Changes - feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#​18648](https://redirect.github.com/sveltejs/svelte/pull/18648)) - feat: add `has` function to `createContext` ([#​18472](https://redirect.github.com/sveltejs/svelte/pull/18472)) - feat: support `defaultValue` on `<select>` ([#​18591](https://redirect.github.com/sveltejs/svelte/pull/18591)) - feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#​18728](https://redirect.github.com/sveltejs/svelte/pull/18728)) ##### Patch Changes - fix: block template store subscriptions on the promise that assigns the store ([#​18582](https://redirect.github.com/sveltejs/svelte/pull/18582)) - fix: route $derived teardown errors through invoke\_error\_boundary ([#​18486](https://redirect.github.com/sveltejs/svelte/pull/18486)) - fix: track SvelteDate snapshots in reactions ([#​18700](https://redirect.github.com/sveltejs/svelte/pull/18700)) - fix: remove `<svelte:head>` anchors on unmount ([#​18697](https://redirect.github.com/sveltejs/svelte/pull/18697)) - fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#​18480](https://redirect.github.com/sveltejs/svelte/pull/18480)) - perf: reuse the cached value in the `<option>`/`<select>` value guard ([#​18713](https://redirect.github.com/sveltejs/svelte/pull/18713)) - fix: prevent malformed AST output for `<select>` with static `value` attribute ([#​18449](https://redirect.github.com/sveltejs/svelte/pull/18449)) - fix: apply ownership mutation ignores to binding assignments ([#​18718](https://redirect.github.com/sveltejs/svelte/pull/18718)) - fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#​18655](https://redirect.github.com/sveltejs/svelte/pull/18655)) - fix: preserve whitespace after inline elements when printing ([#​18685](https://redirect.github.com/sveltejs/svelte/pull/18685)) - perf: fold SSR block-open markers into the branch's first push ([#​18712](https://redirect.github.com/sveltejs/svelte/pull/18712)) - fix: run `onDestroy` callbacks when a server render throws ([#​18585](https://redirect.github.com/sveltejs/svelte/pull/18585)) - fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#​18692](https://redirect.github.com/sveltejs/svelte/pull/18692)) - fix: never apply class hash to elements inside `<svelte:head>` ([#​18160](https://redirect.github.com/sveltejs/svelte/pull/18160)) - fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#​18701](https://redirect.github.com/sveltejs/svelte/pull/18701)) - fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#​18689](https://redirect.github.com/sveltejs/svelte/pull/18689)) - perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#​18602](https://redirect.github.com/sveltejs/svelte/pull/18602)) - fix: distinct memoizer on style/class directives ([#​18466](https://redirect.github.com/sveltejs/svelte/pull/18466)) - fix: measure nested transitions before applying their starting styles ([#​18647](https://redirect.github.com/sveltejs/svelte/pull/18647)) - fix: don't turn component instances stored in `$state` into state proxies ([#​18646](https://redirect.github.com/sveltejs/svelte/pull/18646)) - perf: emit `$.only_child` for elements with a single child ([#​18717](https://redirect.github.com/sveltejs/svelte/pull/18717)) - fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#​18724](https://redirect.github.com/sveltejs/svelte/pull/18724)) - fix: more robust rendering of Svelte custom element slots ([#​18710](https://redirect.github.com/sveltejs/svelte/pull/18710)) - perf: optimize simple object destructuring in `@const` tags ([#​18390](https://redirect.github.com/sveltejs/svelte/pull/18390)) - fix: properly apply static textarea value attribute during CSR ([#​18727](https://redirect.github.com/sveltejs/svelte/pull/18727)) - fix: end a restored reaction context at the end of its synchronous segment ([#​18694](https://redirect.github.com/sveltejs/svelte/pull/18694)) - fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#​18703](https://redirect.github.com/sveltejs/svelte/pull/18703)) - fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#​18431](https://redirect.github.com/sveltejs/svelte/pull/18431)) - perf: use `$.comment()` for single-comment templates ([#​18714](https://redirect.github.com/sveltejs/svelte/pull/18714)) - chore: move `@types/trusted-types` to devDependencies ([#​18730](https://redirect.github.com/sveltejs/svelte/pull/18730)) - perf: store setters cache as `Set` instead of `Array` ([#​18251](https://redirect.github.com/sveltejs/svelte/pull/18251)) - fix: transform derived assignments and select function bindings correctly during server-side rendering ([#​18669](https://redirect.github.com/sveltejs/svelte/pull/18669)) - fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#​18721](https://redirect.github.com/sveltejs/svelte/pull/18721)) - fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#​18705](https://redirect.github.com/sveltejs/svelte/pull/18705)) - fix: block declaration tags and `{@const}` on async values read inside closures ([#​18533](https://redirect.github.com/sveltejs/svelte/pull/18533)) - fix: avoid css tree-shaking for exported Snippet ([#​18540](https://redirect.github.com/sveltejs/svelte/pull/18540)) - perf: treat `<img loading>` as a static element again ([#​18711](https://redirect.github.com/sveltejs/svelte/pull/18711)) - fix: prevent `selectedcontent` mutation from changing the selected option ([#​18495](https://redirect.github.com/sveltejs/svelte/pull/18495)) - fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#​18430](https://redirect.github.com/sveltejs/svelte/pull/18430)) - fix: preserve line feed character references in attribute values ([#​18691](https://redirect.github.com/sveltejs/svelte/pull/18691)) - fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#​18708](https://redirect.github.com/sveltejs/svelte/pull/18708)) - chore: clarify when `$effect.pre` runs relative to DOM updates ([#​18534](https://redirect.github.com/sveltejs/svelte/pull/18534)) - fix: scope SSR boundary failed snippets to their boundary ([#​18593](https://redirect.github.com/sveltejs/svelte/pull/18593)) </details> <details> <summary>tinylibs/tinypool (tinypool)</summary> ### [`v2.1.2`](https://redirect.github.com/tinylibs/tinypool/releases/tag/v2.1.2) [Compare Source](https://redirect.github.com/tinylibs/tinypool/compare/v2.1.1...v2.1.2) Contains security fix for <https://github.com/tinylibs/tinypool/security/advisories/GHSA-85c8-ppgw-ccpr>. #### What's Changed - fix: guard worker filename from proto pollution by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [#​135](https://redirect.github.com/tinylibs/tinypool/pull/135) **Full Changelog**: <https://github.com/tinylibs/tinypool/compare/v2.1.1...v2.1.2> ### [`v2.1.1`](https://redirect.github.com/tinylibs/tinypool/releases/tag/v2.1.1) [Compare Source](https://redirect.github.com/tinylibs/tinypool/compare/v2.1.0...v2.1.1) Contains security fix for <https://github.com/tinylibs/tinypool/security/advisories/GHSA-5gmw-xhrv-c9v3>. #### What's Changed - fix: guard worker options from proto pollution by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [#​134](https://redirect.github.com/tinylibs/tinypool/pull/134) **Full Changelog**: <https://github.com/tinylibs/tinypool/compare/v2.1.0...v2.1.1> </details> --- ### Configuration 📅 **Schedule**: (in timezone Asia/Shanghai) - Branch creation - "before 10am on monday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://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:eyJjcmVhdGVkSW5WZXIiOiI0NC40OS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNDkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cameron <cameron.clark@hey.com> |
||
|
|
0b4e2e67f4 |
release(apps): oxlint v1.81.0 && oxfmt v0.66.0 (#26199)
# Oxlint ### 🚀 Features - |
||
|
|
894c8f9cd8 |
release(crates): oxc v0.148.0 (#26198)
### 💥 BREAKING CHANGES - |
||
|
|
5ff57f83c0 |
fix(formatter/sort-imports): handle custom side effect groups (#26217)
Fixes #26165 - `side_effect` is predefined selector, it cannot be used as custom group name - respect custom group which uses `side_effect` as side-effect-import correctly - fix metadata detection bug |
||
|
|
d5be0375e6 |
docs(linter/typescript/switch-exhaustiveness-check): clarify default case comment pattern (#26100)
## Summary - clarify that `defaultCaseCommentPattern` recognizes a trailing comment in place of an omitted `default` clause - document the required location, absence of a live `default`, and the `considerDefaultExhaustiveForUnions` requirement for union switches - regenerate the JSON schema and TypeScript configuration types Fixes #26087 |
||
|
|
63bc313934 |
chore(npm): update funding URL (#26066)
Update npm package funding links to the Oxc organization sponsorship page. Closes #26062. AI-assisted with Codex. |
||
|
|
97e99b8548 |
release(apps): oxlint v1.80.0 && oxfmt v0.65.0 (#26045)
# Oxlint ### 🚀 Features - |
||
|
|
4e258430cd |
release(crates): oxc v0.147.0 (#26046)
### 🚀 Features - |
||
|
|
0389c4010e |
release(crates): oxc v0.146.0 (#25912)
### 🚀 Features - |
||
|
|
0db127cc16 |
release(apps): oxlint v1.79.0 && oxfmt v0.64.0 (#25866)
# Oxlint ### 💥 BREAKING CHANGES - |
||
|
|
4a4a1fb2e7 |
release(crates): oxc v0.145.0 (#25865)
### 💥 BREAKING CHANGES - |
||
|
|
228e8e0f85 |
fix(linter): resolve inactive React compiler rules (#25830)
Enable React Compiler memo dependency validation so `react/memo-dependencies` reports missing and extra values. Remove `react/gating` until Oxlint exposes compiler gating options. Validated with `just ready`. AI-assisted. |
||
|
|
aa49d86046 |
fix(linter): allow spread rule options in config types (#25675)
## Summary - represent variadic rule options as a severity followed by zero or more option values - regenerate the Oxlint configuration schema and TypeScript declarations - add a type-level regression for mapped options spread into `no-restricted-globals` ## Root cause The schema wrapper materialized the first `additionalItems` entry as a required tuple element and set `minItems` to 2. A dynamic TypeScript spread has type `T[]` and may be empty, so it cannot satisfy that required position even though the severity-only form is already valid through `RuleNoConfig`. Keeping severity as the only fixed tuple item and leaving the rule options in `additionalItems` generates `[severity, ...options]`, which accepts both an empty spread and populated spreads without changing runtime rule behavior. Closes #25666 ## AI assistance Implemented with assistance from OpenAI Codex. The contributor remains responsible for reviewing, understanding, and submitting the change under the repository AI usage policy. --------- Co-authored-by: Cameron <cameron.clark@hey.com> |
||
|
|
892238149b |
refactor(linter): remove inactive react config rule (#25740)
Remove the inactive `react/config` rule and its generated metadata. Oxlint uses fixed, valid React Compiler options, so the rule cannot produce actionable diagnostics. AI-assisted: Codex was used to implement and validate this change. |
||
|
|
8c4552dfa6 |
feat(linter)!: split react/react-compiler into per-category rules (#25500)
Splits the experimental `react/react-compiler` rule into 24 category-specific rules matching `eslint-plugin-react-hooks` v7. - Runs React Compiler once per file and routes structured diagnostics to each enabled rule. - Removes `react/react-compiler` and `reportAllBailouts`, with rules categorized by user-facing lint intent. - Adds per-rule documentation and deduplicates shared React lint URLs. - Preserves standardized compiler diagnostics while reporting each finding under its Oxlint rule name. Breaking change: configurations using `react/react-compiler` must migrate to the category-specific rules. Written with Claude Code and Codex. |
||
|
|
36f845168c |
fix(linter/eslint/no-eval): align indirect default with ESLint (#25656)
## Summary - default `allowIndirect` to `false`, matching ESLint's `no-eval` behavior - report bare global `eval` references and declared global-object member access by default - avoid duplicate diagnostics for direct global calls while preserving `allowIndirect: true` - add regression coverage, including an ESLint disable-next-line directive Closes #25619. |
||
|
|
beb724dce2 |
fix(linter/eslint/no-unused-vars): report bare underscore parameters (#25663)
## Summary - report a bare underscore parameter when no args ignore pattern is configured - preserve the optimized underscore-prefix behavior for explicit argsIgnorePattern configuration - update focused rule coverage and generated documentation Closes #25626 |
||
|
|
4004c101ca |
fix(linter/eslint/no-irregular-whitespace): check comments by default (#25660)
## Summary - align the skipComments default with ESLint - report irregular whitespace in line and block comments by default - preserve the skipComments: true opt-out - verify suppressed comment diagnostics count disable directives as used - regenerate the published configuration schema Fixes #25616. |
||
|
|
285820eed6 |
fix(linter/no-large-snapshots): precompile and document allowed snapshot matchers (#25611)
issue #23594 - Move regex compilation to configuration parsing to avoid recompiling patterns for every snapshot entry - Document the matching behavior of allowedSnapshots (first interpret as regex, if not valid match as string) - Fix a small typo where both example sections were labeled “incorrect" - Replace manual config parsing with DefaultRuleConfig |
||
|
|
c07fe7c217 |
feat(oxfmt): support experimentalOperatorPosition (#25643)
Fixes #16366 --- Option name requires `experimental` prefix for now. Values are: - `"start"` - `"end"`(default) This is also available on playground. |
||
|
|
0c68b7ff8b |
fix(estree): emit decorators on FormalParameterRest (#25582)
This PR adds support for emitting `decorators` when serializing an ast to ESTree (both with/without raw transfer).
Given the following code:
```
class C { method(@dec ...args) {} }
```
Before we emitted the following ESTree shape:
```json
"params": [
{
"type": "RestElement",
"decorators": [],
"argument": {
"type": "Identifier",
"decorators": [],
"name": "args",
"optional": false,
"typeAnnotation": null,
},
"optional": false,
"typeAnnotation": null,
"value": null,
}
],
```
Now we emit:
```json
"params": [
{
"type": "RestElement",
"decorators": [
{
"type": "Decorator",
"expression": { "type": "Identifier", "name": "dec" }
}
],
"argument": {
"type": "Identifier",
"decorators": [],
"name": "args",
"optional": false,
"typeAnnotation": null,
},
"optional": false,
"typeAnnotation": null,
"value": null,
},
],
```
fixes https://github.com/oxc-project/oxc/issues/18981
closes https://github.com/oxc-project/oxc/pull/24736
|
||
|
|
fed6681eda |
docs(oxfmt): skip expanding overrides options (#25572)
Follow up on #25544. Oxlint also omits `overrides[].rules`. |
||
|
|
4df5835fc3 |
fix(linter): allow capitalized built-in calls (#25516)
Fixes #24405. The React Compiler global registry omitted `BigInt` and `Symbol`, causing `CapitalizedCalls` false positives. Register both primitives and expose the upstream-compatible `environment.validateNoCapitalizedCalls` option. Validated with `just ready`. AI-assisted: Codex was used to investigate and implement this change. |
||
|
|
c42d6397ea |
release(apps): oxlint v1.78.0 && oxfmt v0.63.0 (#25473)
# Oxlint ### 💥 BREAKING CHANGES - |
||
|
|
b6f1458dec |
release(crates): oxc v0.144.0 (#25474)
### 💥 BREAKING CHANGES - |
||
|
|
00f490d7f7 |
refactor(oxfmt,formatter): split sortImports validation and use type enum (#25432)
Reduce runtime validation. Also, by using type `enum`, IDE and TS types are also covered. |
||
|
|
ccb8fe89db |
feat(linter/jsdoc): implement no-blank-blocks rule (#25207)
this PR implements `jsdoc/no-blank-blocks` rule, issue #1170 |
||
|
|
9573937df3 |
fix(linter/typescript): validate ban-ts-comment description_format (#25320)
adds validation for the `descriptionFormat` regex option from #23594 and replaces manual config parsing with `DefaultRuleConfig` |
||
|
|
44fd320324 |
feat(ast)!: split TS external modules & Namespace Declarations (#25284)
## Summary
- Splits `TSModuleDeclaration` into two dedicated declaration nodes:
- `TSExternalModuleDeclaration` for string-literal modules and module augmentations.
- `TSNamespaceDeclaration` for identifier-based `module` and `namespace` declarations.
- Removes `TSModuleDeclaration`, `TSModuleDeclarationName`, `TSModuleDeclarationBody`, and `TSModuleDeclarationKind`.
- Makes invalid combinations of names, bodies, and declaration kinds unrepresentable.
- Ensures only namespace declarations introduce a normal binding.
- Updates all AST consumers, generators, traversal, formatting, code generation, semantic analysis, lint rules, transforms, and serialization.
- Keeps normal and eager-raw ESTree output compatible: both declarations remain `TSModuleDeclaration` nodes.
- Allows experimental lazy raw deserialization to expose the two new node types directly.
## Breaking Change
The Rust AST changes from:
```rust
pub enum Declaration<'a> {
VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 32,
FunctionDeclaration(Box<'a, Function<'a>>) = 33,
ClassDeclaration(Box<'a, Class<'a>>) = 34,
TSTypeAliasDeclaration(Box<'a, TSTypeAliasDeclaration<'a>>) = 35,
TSInterfaceDeclaration(Box<'a, TSInterfaceDeclaration<'a>>) = 36,
TSEnumDeclaration(Box<'a, TSEnumDeclaration<'a>>) = 37,
TSModuleDeclaration(Box<'a, TSModuleDeclaration<'a>>) = 38,
TSGlobalDeclaration(Box<'a, TSGlobalDeclaration<'a>>) = 39,
TSImportEqualsDeclaration(Box<'a, TSImportEqualsDeclaration<'a>>) = 40,
}
pub struct TSModuleDeclaration<'a> {
pub node_id: Cell<NodeId>,
pub span: Span,
pub id: TSModuleDeclarationName<'a>,
pub body: Option<TSModuleDeclarationBody<'a>>,
pub kind: TSModuleDeclarationKind,
pub declare: bool,
pub scope_id: Cell<Option<ScopeId>>,
}
```
to:
```rust
pub enum Declaration<'a> {
VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 32,
FunctionDeclaration(Box<'a, Function<'a>>) = 33,
ClassDeclaration(Box<'a, Class<'a>>) = 34,
TSTypeAliasDeclaration(Box<'a, TSTypeAliasDeclaration<'a>>) = 35,
TSInterfaceDeclaration(Box<'a, TSInterfaceDeclaration<'a>>) = 36,
TSEnumDeclaration(Box<'a, TSEnumDeclaration<'a>>) = 37,
TSExternalModuleDeclaration(Box<'a, TSExternalModuleDeclaration<'a>>) = 38,
TSNamespaceDeclaration(Box<'a, TSNamespaceDeclaration<'a>>) = 39,
TSGlobalDeclaration(Box<'a, TSGlobalDeclaration<'a>>) = 40,
TSImportEqualsDeclaration(Box<'a, TSImportEqualsDeclaration<'a>>) = 41,
}
pub struct TSExternalModuleDeclaration<'a> {
pub node_id: Cell<NodeId>,
pub span: Span,
pub id: StringLiteral<'a>,
pub body: Option<Box<'a, TSModuleBlock<'a>>>,
pub declare: bool,
pub scope_id: Cell<Option<ScopeId>>,
}
pub struct TSNamespaceDeclaration<'a> {
pub node_id: Cell<NodeId>,
pub span: Span,
pub id: BindingIdentifier<'a>,
pub body: TSNamespaceDeclarationBody<'a>,
pub kind: TSNamespaceDeclarationKind,
pub declare: bool,
pub scope_id: Cell<Option<ScopeId>>,
}
pub enum TSNamespaceDeclarationBody<'a> {
TSNamespaceDeclaration(Box<'a, TSNamespaceDeclaration<'a>>) = 0,
TSModuleBlock(Box<'a, TSModuleBlock<'a>>) = 1,
}
pub enum TSNamespaceDeclarationKind {
Module = 0,
Namespace = 1,
}
```
The corresponding inherited `Statement` variants, `AstKind` variants, builders, and visitor methods have also changed.
## Why?
`TSModuleDeclaration` previously represented two declaration families with different syntax and semantics:
```ts
declare module "foo" {}
declare module "*.css";
module Foo {}
namespace Foo {}
namespace Foo.Bar {}
```
The shared representation allowed invalid states such as:
- A namespace with a string-literal name.
- An external module with an identifier name.
- An identifier namespace without a body.
- A dotted external module.
- An external module containing another module declaration as its body.
- A declaration whose `kind` disagreed with its name.
Consumers also had to inspect `id` before determining whether the node introduced a binding or represented an external module.
The two declaration families have stronger independent invariants:
### External modules
- Always have a string-literal name.
- Never introduce a normal binding identifier.
- May omit their body.
- Cannot use dotted names.
- Use module-body import and export rules.
### Namespace declarations
- Always have a binding identifier.
- Always have a body.
- May contain nested namespace declarations for dotted names.
- Explicitly preserve the `module` or `namespace` spelling.
- Introduce a namespace/module symbol.
- Use namespace-body restrictions.
Dedicated nodes encode these differences directly.
## Declaration forms
External modules use `TSExternalModuleDeclaration`:
```ts
declare module "foo" {}
declare module "*.css";
module "foo" {}
```
Identifier-based declarations use `TSNamespaceDeclaration`:
```ts
module Foo {}
namespace Foo {}
```
Dotted namespaces are represented as nested namespace declarations:
```ts
namespace Foo.Bar {}
```
```rust
TSNamespaceDeclaration {
id: Foo,
body: TSNamespaceDeclarationBody::TSNamespaceDeclaration(
TSNamespaceDeclaration {
id: Bar,
body: TSNamespaceDeclarationBody::TSModuleBlock(...),
// ...
}
),
// ...
}
```
Only `TSExternalModuleDeclaration::body` is optional.
## ESTree compatibility
Normal serialization and eager raw deserialization continue to emit the existing ESTree shape:
```ts
interface TSModuleDeclaration {
type: "TSModuleDeclaration";
id: BindingIdentifier | StringLiteral | TSQualifiedName;
body: TSModuleBlock | null;
kind: "module" | "namespace";
declare: boolean;
global: false;
}
```
Dotted namespaces continue to serialize as a single `TSModuleDeclaration` with a `TSQualifiedName`.
Experimental lazy raw deserialization is not compatibility-preserving. It now exposes `TSExternalModuleDeclaration` and `TSNamespaceDeclaration` directly, with separate constructors, layouts, and visitor type IDs.
## How to migrate
Code that previously matched all forms through one variant:
```rust
if let Declaration::TSModuleDeclaration(declaration) = declaration {
// ...
}
```
should now match the required declaration family:
```rust
match declaration {
Declaration::TSExternalModuleDeclaration(declaration) => {
// String-literal external module
}
Declaration::TSNamespaceDeclaration(declaration) => {
// Identifier-based module or namespace
}
_ => {}
}
```
The same applies to `Statement` and `AstKind`:
```rust
Statement::TSExternalModuleDeclaration(declaration)
Statement::TSNamespaceDeclaration(declaration)
AstKind::TSExternalModuleDeclaration(declaration)
AstKind::TSNamespaceDeclaration(declaration)
```
Common field migrations:
| Previous representation | New representation |
| --- | --- |
| `TSModuleDeclarationName::StringLiteral(id)` | `TSExternalModuleDeclaration::id` |
| `TSModuleDeclarationName::Identifier(id)` | `TSNamespaceDeclaration::id` |
| `body: None` | Only valid on `TSExternalModuleDeclaration` |
| `TSModuleDeclarationBody::TSModuleBlock` | External `body` or `TSNamespaceDeclarationBody::TSModuleBlock` |
| `TSModuleDeclarationBody::TSModuleDeclaration` | `TSNamespaceDeclarationBody::TSNamespaceDeclaration` |
| `TSModuleDeclarationKind::Module` | External module, or `TSNamespaceDeclarationKind::Module` |
| `TSModuleDeclarationKind::Namespace` | `TSNamespaceDeclarationKind::Namespace` |
| Inspect `id` to determine binding behavior | Match `TSNamespaceDeclaration` |
| `declaration.id()` for string modules | Now returns `None` |
| `visit_ts_module_declaration` | `visit_ts_external_module_declaration` or `visit_ts_namespace_declaration` |
When constructing nodes, use the generated `TSExternalModuleDeclaration` or `TSNamespaceDeclaration` builders rather than recreating the previous shared representation.
fixes https://github.com/oxc-project/backlog/issues/218
|
||
|
|
d4a897ce22 |
feat(linter/eslint): implement one-var rule (#24470)
## Summary Adds a native Oxlint implementation of [ESLint's `one-var` rule](https://eslint.org/docs/latest/rules/one-var). This implementation is a port of the [eslint rule source](https://github.com/eslint/eslint/blob/main/lib/rules/one-var.js), test suite, and autofix logic. Related #479 ## AI Disclosure GPT 5.6 Sol was used to assist with implementation of this rule. --------- Co-authored-by: Cameron <cameron.clark@hey.com> |
||
|
|
5ab9340637 |
feat(linter/jsx-a11y/anchor-has-content): add options to match eslint (#24571)
## Description Eslint supports [a `components` option](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md) for `jsx-a11y/anchor-has-content` that specified additional components to treat as anchor elements. This adds equivalent support for that option. Note: I am not certain if this is something that should instead be read off of [`settings.jsx-a11y.components`](https://oxc.rs/docs/guide/usage/linter/config-file-reference.html#settings-jsx-a11y-components), as that could list `{ MyAnchor: 'a' }`. Doing that would enable implicit application of rules to custom components based on rendered entity, but that may be the wrong use case, as the custom component definition itself could be responsible for rendering required children. ## AI disclosure I used GPT 5.6 Sol to assist in implementation of this fix. I've reviewed all generated code and test coverage. --------- Signed-off-by: Cameron <cameron.clark@hey.com> Co-authored-by: Cameron <cameron.clark@hey.com> |
||
|
|
9a423f2f48 |
release(apps): oxlint v1.77.0 && oxfmt v0.62.0 (#25251)
# Oxlint ### 💥 BREAKING CHANGES - |
||
|
|
45a17c25d1 |
release(crates): oxc v0.143.0 (#25250)
### 💥 BREAKING CHANGES - |
||
|
|
5c0fa61ddb |
fix(linter/eslint/no-warning-comments): unify config structs and remove manual options docs (#25151)
this PR unifies 2 config structs for `eslint/no-warning-comments` and removes the manually written options doc, related issue: #14743. Doc after fix: <img width="919" height="1295" alt="image" src="https://github.com/user-attachments/assets/dab8f999-fffa-4a77-8d6d-39746cfa3860" /> |
||
|
|
9dc7756729 |
docs(linter/typescript/no-unnecessary-condition): clarify options (#25110)
## Summary - document the exact allowConstantLoopConditions behavior, including the four directly allowed literals - explain how always differs from only-allowed-literals - add a checkTypePredicates example and regenerate the published configuration schema Closes #25098 |
||
|
|
e6e584b9be |
fix(oxfmt): type jsdoc. enum options (#25008)
Fixes #24999 |
||
|
|
65fe65d842 |
release(apps): oxlint v1.76.0 && oxfmt v0.61.0 (#24976)
# Oxlint ### 🚀 Features - |
||
|
|
fc702c1fa9 |
release(crates): oxc v0.142.0 (#24977)
### 💥 BREAKING CHANGES - |
||
|
|
3ff2e0e6fa |
docs(linter): clarify config extends types (#24936)
The generated config reference only described the JSON schema's `string[]` form. Clarify that `oxlint.config.ts` accepts imported `OxlintConfig[]`, add an example and public JSDoc, and regenerate the derived artifacts. Closes #20238. Validated with the website generator suite, targeted TypeScript checks, and the relevant Oxlint tests. The full `just ready` run reached an unrelated parallel suppression-fixture cleanup race; the failing test passes in isolation. AI-assisted. |
||
|
|
8d31dfa393 |
feat(linter): verify eslint/no-restricted-globals config schema (#24598)
Part of #22955. Follow-up to the resolved #23617. ## What `eslint/no-restricted-globals` stayed in `NO_VERIFIED_VALID_SCHEMA` after #23617 was resolved, because the derived schema described the internal `NoRestrictedGlobalsConfig` struct (a `globals` hash map) rather than the user-facing positional-array format the rule actually parses. This PR adds a hand-written `JsonSchema` following the existing `no-restricted-imports` pattern, describing the three accepted positional item forms: 1. `"event"` — a global name string 2. `{ "name": "event", "message": "…" }` — a name/message object 3. `{ "globals": [ … ], "checkGlobalObject": true, "globalObjects": [ … ] }` — the object form added in #23617 Generated TS declaration: ```ts "no-restricted-globals"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedGlobalsConfigEnum, ...NoRestrictedGlobalsConfigEnum[]]; export type NoRestrictedGlobalsConfigEnum = string | RestrictedGlobal | NoRestrictedGlobalsObjectConfig; ``` Verified against the #22955 checklist: reflects all accepted user configuration forms, denies unknown fields on object forms, and produces no `[k: string]: unknown` in the TS declaration. `from_configuration` and rule behavior are unchanged; rule tests pass. Note: this branch removes only the `no-restricted-globals` entry from `NO_VERIFIED_VALID_SCHEMA`; #24586 (separate PR) removes the `filename-case` entry, so whichever merges second will have a trivial conflict in that array. ## Disclosure This contribution was developed with assistance from Claude Code (Anthropic); I have reviewed and tested all changes. --------- Signed-off-by: Alexander S. <sysix@sysix-coding.de> Co-authored-by: Alexander S. <sysix@sysix-coding.de> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
7069621199 |
feat(linter): verify jest/vitest prefer-lowercase-title config schema (#24724)
## Summary - Unskip `jest/prefer-lowercase-title` and `vitest/prefer-lowercase-title` from `NO_VERIFIED_VALID_SCHEMA`. - PreferLowercaseTitleConfig already derives `Deserialize` + `JsonSchema` with `deny_unknown_fields` and docs for all public options, so the generated schema/types can describe the real config. - Regenerates `npm/oxlint/configuration_schema.json` and `apps/oxlint/src-js/package/config.generated.ts`. ## Motivation Part of #22955. These two plugin names shared a clean config struct already used at runtime; they were still emit-as-`DummyRule` only because of the broader #23186 split note (mainly about `valid-title` option divergence). Leaving `valid-title` skipped. Generated config now exposes: - `allowedPrefixes: string[]` (default `[]`) - `ignore: string[]` (default `[]`) - `ignoreTopLevelDescribe: boolean` (default `false`) - `lowercaseFirstCharacterOnly: boolean` (default `true`) - `additionalProperties: false` / no `[k: string]: unknown` ## Verification - `cargo test -p website_linter` — 8 passed - `cargo test -p oxc_linter --features ruledocs test_rules_with_custom_configuration_have_schema` — passed - `cargo test -p oxc_linter prefer_lowercase_title --lib` — 2 passed (jest + vitest) - Inspected generated schema/TS: not DummyRule; no index signature ## AI disclosure Assisted by AI (Hermes/Sera). I reviewed the existing PreferLowercaseTitleConfig against the GFI checklist, regenerated schema/types locally, and ran the tests above. --- **Agent-Owner:** `sera` · **Platform:** hermes · **Claim:** `sera` --- <!-- fleet-pr-claim: agent_id=sera platform=hermes --> **Agent-Owner:** `sera` · **Platform:** hermes · **Claim-TTL:** 24h --------- Co-authored-by: Bartok9 <259807879+Bartok9@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
016cf2acd6 |
feat(linter/oxc): add bad-match-all-arg rule (#24900)
## Summary - add oxc/bad-match-all-arg for non-global regular expressions passed to matchAll - share cycle-safe RegExp flag resolution with bad-replace-all-arg - support callable and global-qualified RegExp constructors - update generated metadata, diagnostics, timings, and CLI rule-count snapshots Closes #24823. |
||
|
|
cdc941e5f8 |
feat(linter/n): implement exports-style rule (#24087)
this PR implements `n/exports-style` rule. Issue #493 --------- Co-authored-by: Cameron <cameron.clark@hey.com> |
||
|
|
1ad6f6c823 |
feat(linter/eslint): implement id-denylist rule (#24632)
this PR implements `eslint/id-denylist`, issue #479 |
||
|
|
83abe3b49c |
release(apps): oxlint v1.75.0 && oxfmt v0.60.0 (#24713)
# Oxlint ### 💥 BREAKING CHANGES - |
||
|
|
14533a3dc1 |
release(crates): oxc v0.141.0 (#24714)
### 💥 BREAKING CHANGES - |
||
|
|
6ce51d3ff3 | chore(deps): update dependency oxlint-tsgolint to v7.0.2000 (#24763) | ||
|
|
dd18383ee1 |
feat(linter/node): implement no-top-level-await rule (#24634)
This implements
[`no-top-level-await`](https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-top-level-await.md)
from the Node ESLint plugin (#493).
AI Disclosure: Generated with Claude Code. Reviewed and tested by me.
I have an alternative implementation using a Program visitor but it made
no difference performance-wise on vscode or in benchmarking outside
extreme cases, so I don't think it's really worth the trouble vs the
simpler implementation here. It's still in the commit history if that
implementation is preferred.
There is one notable difference between this and the original
implementation, which is that the `convertPath` option is not
implemented, and the checking of `package.json`/`.npmignore` is not
implemented (it was used for checking if the given module was actually
exposed in the library) as there's no way to check against those in
oxlint. There's an argument to be made that this makes the rule not
worth implementing, and I'm open to that argument if we'd prefer to mark
this rule as unsupported instead.
All tests were ported from the original rule (excluding those reliant on
the mentioned config options/checks that were skipped). I've also had
Claude add a few additional test cases (see commit
|