#26263 added the ability to run tests and conformance for both versions of `oxc_lexer` (SIMD and scalar fallback) on any platform.
Run tests and conformance on CI (both SIMD and scalar) on any PR which touches `oxc_lexer` crate or other files which affect conformance runner.
Additionally, run Clippy on the SIMD version (main Lint CI task doesn't lint it, due to the `target_feature = "avx2"` gate on the code).
All of this sets up `oxc_lexer` crate for further development, catching any regressions in CI.
Follow-on after #26263. That PR added `just` commands to run `oxc_lexer` tests and conformance on any platform. Add a comment to the justfile pointing to solution for the cryptic error you get if `x86_64-apple-darwin` target is not installed on an M-chip Mac (it's not by default).
`oxc_lexer` has 2 implementations:
1\. SIMD-based on x86_64 with AVX2.
2\. Scalar/SWAR fallback which works on all platforms.
Both produce the same output.
This PR enables running the lexer conformance on either implementation. Which implementation is tested depends on what build flags are passed to `cargo coverage`.
It turns out that it's possible to test the SIMD implementation on Mac by compiling as x86_64, and running it under Rosetta 2.
This PR also adds `just` recipes to run tests and conformance on either implementation:
- `just test-lexer`
- `just test-lexer-simd`
- `just conformance-lexer`
- `just conformance-lexer-simd`
These commands should work correctly on any of Linux x86, Windows x86, Mac aarch64.
Sometimes it can be useful to run a command just for a specific crate.
Alter `just` commands to support e.g. `just test -p oxc_parser`, `just doc -p oxc_semantic`.
Rust 1.97 stabilized [`build.warnings`](https://blog.rust-lang.org/2026/07/09/Rust-1.97.0/#cargo-support-for-denying-warnings) / `CARGO_BUILD_WARNINGS`, which denies warnings at the cargo level instead of via clippy args.
Unlike `-D warnings`, the env var is not part of the build fingerprint, so `just lint`, plain `cargo lint`, and rust-analyzer now share one check cache instead of re-linting the workspace whenever the flags alternate. Cached warnings are still replayed and denied, so warm caches leave no enforcement hole.
Verified on cargo 1.97: clippy-only lints are denied (exit 101) despite the cargo reference only mentioning "rustc lints", and denial fires from a fully cached run. The justfile recipe exports the variable via a just parameter (cross-platform, and overridable with `just lint warn`).
rustdoc keeps `RUSTDOCFLAGS='-D warnings'` — `build.warnings` does not cover rustdoc lints.
## Summary
- migrate the transform fixture updater from JavaScript to TypeScript using Node native type stripping
- update the just recipe to execute the TypeScript file
Adds linter call count tracking to provide some durable evidence of call count reductions. This does not include the actual rule timings so that it is consistent across machines.
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.
## Summary
- Bump `cargo-shear` from `1.11.2` to `1.12.4` in `justfile`,
`.github/workflows/autofix.yml`, and
`.github/workflows/copilot-setup-steps.yml`.
- Enable `--check-test-targets` (new in 1.12.0) in `just fmt` and the
autofix CI step to flag `test`/`doctest` target settings that don't
match source content; pairs with `--fix` to auto-reconcile.
- Enable `--deny-warnings` and `--format=github` in the autofix CI step
so warnings fail the job (triggering the existing autofix push) and
findings surface as inline PR annotations.
> This PR enhances Oxlint configuration schema fidelity by expanding `DummyRuleMap` to explicitly list all built-in rules as schema properties (improving editor autocomplete), while adding markdown-renderer filtering to avoid generating massive documentation sections for `rules`.
<img width="632" height="391" alt="grafik" src="https://github.com/user-attachments/assets/732bf81b-b090-429a-8bcd-20f0a6a54aa6" />
> ## Pull request overview
> This PR adds automated generation of website documentation for oxlint’s LSP linting options by exposing the LSP options schema, rendering it to markdown, and snapshot-testing the output.
An PR on `oxc-project/website` is needed. Will wait for the next release to improve the LSP & Editor docs too :)
`just doc` run rustdoc with `--all-features` flag.
I discovered that `just doc` was not, for example, catching errors in doc comments in #21425, because the code is behind a feature which is not enabled by default.
## Summary
- Bump `cargo-shear` from 1.10.0 to 1.11.2 in justfile and CI workflows
- Apply `cargo shear --fix`: set `doctest = false` on 6 crates with no
doc tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These build significantly faster for me while letting me still test the
app locally. I remember discussing these a while ago, but we never added
anything to the Justfile for easily using them.
I'm not sure if there are any downsides to this beyond potential
edge-case differences from the release build, but I figure it's probably
worth considering?
---------
Signed-off-by: Connor Shea <connor.james.shea@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
## Summary
- pin `cargo-shear` to `1.9.1` in local setup (`just init`)
- pin `cargo-shear` to `1.9.1` in CI workflows (`autofix`, `update_submodules`, `copilot-setup-steps`)
- add `cargo-shear` ignore metadata for `schemars` in `crates/oxc_span` to avoid a known optional-dependency false-positive
## Validation
- `cargo shear`
- `cargo shear --fix`
## AI Usage Disclosure
This PR was prepared with assistance from an AI coding tool (Codex).
I have reviewed the generated changes and take full responsibility for this PR.
## Summary
- Removes `editors/vscode` directory - code has been moved to
https://github.com/nicholasrice/oxc-vscode
- Removes `tasks/vscode_docs` crate (no longer needed)
- Removes CI and release workflows for VS Code extension
- Updates `editors/README.md` to point to the new repository
- Cleans up references in `.gitignore`, `justfile`, `oxc_release.toml`,
`oxfmtrc.jsonc`, `oxlintrc.json`, and `pnpm-workspace.yaml`
closes#17484🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- The header on rules_enum.rs was being stripped by accident, which was confusing for users. So I fixed that.
- Mark the generated files as generated in `.gitattributes`, for GitHub to understand the diffs are mostly pointless and can be collapsed by default (the CI job enforces that these files be up to date anyway).
- Mark the generated rule files as `merge=ours`. See https://git-scm.com/book/ms/v2/Customizing-Git-Git-Attributes for more info on what that means, but it should make the merge conflicts less problematic.
- Updated `just ready` to include the lintgen command.
- Added `cargo lintgen` to the AGENTS.md file.
AI Disclosure: Used Claude to find the reason for the lack of header comment because I had no idea why it was happening.
This builds on #15763 to change the rules generation for the website repo to emit a JSON file. This will support https://github.com/oxc-project/oxc-project.github.io/pull/782
I have removed the ability to have a link prefix for the generated markdown table, as it was only used for the generated-rules.md file.
And also update the justfile to have a `new-eslint-rule` alias. This is what is rendered in the relevant issue for eslint core rules, so we should support it.
Split out of #17620.
Before this PR, `Oxfmtrc` was defined in `oxc_formatter` to avoid the circular reference `oxc_language_server` > `oxfmt` > `oxc_language_server`....
But now, `oxc_language_server` does not depend on `Oxfmtrc` since LSP implementation has moved to `apps/oxfmt`.
Therefore, by this PR, `Oxfmtrc` is moved to its proper location, in `apps/oxfmt`.
- Moved `Oxfmtrc` from `oxc_formatter` to `apps/oxfmt`
- Re-exposed from `apps/oxfmt`
- Now only `tasks/website_formatter` depends on it
- Also aligned JSON schema generation with `oxlint` by `just formatter-schema-json`
NOTE: In `oxc_formatter`, there are 2 places (`ir_transform` and `fixtures` tests) where we manually convert options from JSON. I'd like to fix this too in the future.
Just like `version.data.js`. Maybe we should unify these cli flags for the website generator and just assume the structure of the website repo? Feels silly to specify all the paths like this.
See https://github.com/oxc-project/oxc-project.github.io/pull/758 for the companion PR in the actual website repo.
This will allow us to update the rule count automatically using JS, and pull it into the website docs like this:
```html
<script setup>
import { data } from './rule-count.data.js';
const ruleCount = data;
// or we can do some basic math to round the ruleCount to the nearest multiple of 5 and then show `645+ rules`
// const ruleCount = Math.ceil(data / 5) * 5;
</script>
# Oxlint
## A large and growing rule set
Oxlint includes [{{ ruleCount }} rules](/docs/guide/usage/linter/rules.md), with coverage across the plugins most teams already use, including:
```
## Plan: Address code review feedback
- [x] Remove references to non-existent `check` command from
documentation
- [x] Update task README to reflect actual CI workflow
- [x] Fix grammar issues in generated output
- [x] Align documentation with actual implementation
## Summary
Addressed all review feedback from copilot-pull-request-reviewer:
1. ✅ **Removed `check` command references** - The documentation claimed
a `check` command existed, but the implementation only has `update`.
Updated docs to match reality.
2. ✅ **Updated CI documentation** - Clarified that CI uses `cargo run -p
vscode_docs update` + `pnpm fmt` + `git diff --exit-code` rather than a
separate check command.
3. ✅ **Fixed grammar issues**:
- "Following configuration are" → "Following configurations are"
(plural)
- "effect the window" → "affect the window" (correct verb)
4. ✅ **Removed incorrect claim** - Documentation said `update` runs
`just fmt` automatically, but it doesn't. The formatting is handled
separately in CI.
The task now accurately documents what it does and the CI workflow
correctly validates that the README stays in sync with package.json.
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Closes#11439
6 months after adding opening the eslint plugin regex issue, and adding
support for regex rules in rule gen, we have implemented none of the
regex rule. Given this, and the fact that these rules can be implemented
via JS plugins, it makes a the most sense to remove support for this
plugin.
cc @connorshea
- Extract Renderer and schema rendering logic from website_linter to website_common
- Add schema-json and schema-markdown commands to website_formatter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
According to Claude, `just ast` in its current form will not work on Windows, as PowerShell does not support `( ... )` for command groupings. Switch to `{ ... }`.
This script was added in #15565. Copilot writes it, Claude critiques it!
Fix#15564.
`oxc_ast_tools` depends on Oxc crates from crates.io, not the local workspace. When AST changes break local crates, the codegen can't compile either - a Catch-22 situation, since running codegen is the only way to fix compilation.
This isn't ideal as it complicates dependency management. Alter `oxc_ast_tools` so it depends on crates from local workspace, and work around the Catch-22 problem by introducing a `generate-js` Cargo feature which disables these dependencies, so the codegen can still compile if they're broken.
## Changes
- **Add `generate-js` Cargo feature** (enabled by default)
- Makes all `oxc_*` dependencies optional, activated only when feature enabled.
- Only JS generators (`RawTransferGenerator`, `TypescriptGenerator`, `ESTreeVisitGenerator`, `RawTransferLazyGenerator`) require these dependencies.
- **Conditional compilation**
- Gate JS generator modules and `Output::Javascript` variant behind `#[cfg(feature = "generate-js")]`
- **Fallback in `just ast`**
```sh
cargo run -p oxc_ast_tools || (
cargo run -p oxc_ast_tools --no-default-features
&& cargo run -p oxc_ast_tools
)
```
First attempts to run full codegen. On failure, regenerates Rust code only, without dependencies (so that `oxc_*` crates will now compile), then retries full generation.
This was being duplicated in multiple places, so I moved
`generate_json_schema` into Oxlintrc to avoid needing to keep those two
places in sync.
`just linter-schema-json` generates the configuration_schema.json so you
don't have to run the tests to regenerate it, which was a very confusing
behavior to figure out as a contributor.
However, this does mean this is now part of the public interface of the
create, so maybe it shouldn't be like this?
`just benchmark-one` was broken when all benchmarks except linter got combined into a single `compiler` cargo feature. Fix it. Add a separate `just benchmark-linter` command for linter (different cargo feature).
## Summary
Adds support for formatting embedded languages (CSS, GraphQL, HTML, Markdown) in JavaScript/TypeScript template literals using Prettier via NAPI bindings.
## Motivation
JavaScript/TypeScript developers often embed CSS, GraphQL queries, HTML, and Markdown in their code using tagged template literals. Without proper formatting support, these embedded languages remain unformatted, leading to inconsistent code style and reduced readability.
This PR enables oxfmt to format these embedded languages using Prettier, providing a seamless formatting experience similar to Prettier's own embedded language support.
## Changes
### Core Functionality
- **Embedded language detection**: Recognizes `css`, `styled`, `gql`, `graphql`, `html`, `md`, and `markdown` template tags
- **Prettier integration**: Uses `@prettier/sync` for synchronous formatting of embedded code
- **NAPI bridge**: Rust-to-JavaScript interop using NAPI ThreadsafeFunction
- **Graceful fallback**: Returns original code if formatting fails or tag is unsupported
### Implementation Details
**Rust side** (`crates/oxc_formatter/`, `apps/oxfmt/src/prettier_plugins/`):
- New `EmbeddedFormatter` trait with callback-based API
- NAPI bindings using `FnArgs` pattern for clean multi-argument calls
- Template formatter enhancement to detect and format tagged templates
- Proper indentation handling: splits Prettier output into lines, uses `hard_line_break()` separators, wraps in `indent()` for context-aware indentation
- Arena allocator pattern to avoid borrow checker conflicts
**JavaScript side** (`apps/oxfmt/src-js/`):
- TypeScript bindings with clean signatures: `formatEmbeddedCode(tagName: string, code: string)`
- Prettier configuration: 80 char width, 2 space indent, semicolons, double quotes
- Tag-to-parser mapping for supported languages
- Error handling with console logging and fallback
**Testing**:
- E2E test suite using Vitest (8 test cases)
- Test fixtures for each supported language
- Snapshot testing with timing normalization for stability
- All tests passing consistently
## Examples
**Before** (unformatted):
```js
const styles = css`.button { color: red; background: blue; }`;
```
**After** (formatted with proper indentation):
```js
const styles = css`
.button {
color: red;
background: blue;
}
`;
```
**Supported tags:**
```js
// CSS
const styles = css`...`;
const component = styled`...`;
// GraphQL
const query = gql`...`;
const schema = graphql`...`;
// HTML
const template = html`...`;
// Markdown
const docs = md`...`;
const readme = markdown`...`;
```
## Testing
```bash
# Run oxfmt tests
just oxfmt
# Watch mode for development
just watch-oxfmt
```
All 8 E2E tests pass:
- ✓ embedded_css
- ✓ embedded_graphql
- ✓ embedded_html
- ✓ embedded_markdown
- ✓ mixed_embedded
- ✓ no_embedded
- ✓ unsupported_tag
- ✓ check_mode
## Related
Related to #13427
## Future Work
Potential enhancements:
- Support for additional embedded languages (SQL, YAML, etc.)
- Custom Prettier configuration via oxfmt config
- Performance optimization for large embedded blocks
- Integration with language servers for inline diagnostics
## Summary
- Moved `clone-parallel.sh` from `.github/actions/clone-submodules/` to `.github/scripts/` for better organization and reusability
- Updated justfile `submodules` recipe to use the centralized script, eliminating duplication
- Fixed issue where script would fail with "destination path already exists" error when directories already exist
- Script now properly handles existing directories by initializing or updating git repos instead of failing
🤖 Generated with [Claude Code](https://claude.com/claude-code)