Commit Graph

30 Commits

Author SHA1 Message Date
Boshen 1193c9dbaf chore(oxfmt): dogfood operator position at line start (#25937)
dogfood
2026-08-20 14:36:47 +00:00
leaysgur f99ecdaa76 feat(oxlint): Gate vite.config.ts recognition behind VP_VERSION env var (#21298)
Fixes #20416 for Oxlint

- Same `VP_VERSION` gating for config discovery, LSP file watchers, and JS config loading
- Refactor JS config loader into `resolveJsConfig` / `resolveVitePlusConfig` with shared `importConfig` + `loadConfigs`
- Split test fixtures into `vite_config_*` (non VP mode) and `vite_plus_*` (VP mode)
- Add `env` field to fixture `options.json` for passing env vars to test runs
- Fix repo `oxlintrc.json` ignore glob (`*/files/**` → `**/files/**`) for nested fixture paths like monorepo usecase
2026-04-13 01:10:46 +00:00
Sysix 87318e72fd fix(oxlint/lsp): load js config with reforcing fs read (#19551)
closes https://github.com/oxc-project/oxc/issues/19526

> This PR fixes a bug in the LSP where JavaScript/TypeScript config files were not being reloaded when changed. The fix implements cache-busting by appending a timestamp query parameter to file URLs during import, forcing Node.js to bypass its module cache.
2026-03-03 18:35:12 +00:00
renovate 706be70035 chore(deps): update dependency oxlint-tsgolint to v0.13.0 (#19397)
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/) |
|---|---|---|---|---|---|
| [oxlint-tsgolint](https://redirect.github.com/oxc-project/tsgolint) | [`0.12.2` → `0.13.0`](https://renovatebot.com/diffs/npm/oxlint-tsgolint/0.12.2/0.13.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint-tsgolint/0.13.0?slim=true) | ![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint-tsgolint/0.13.0?slim=true) | ![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint-tsgolint/0.12.2/0.13.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint-tsgolint/0.12.2/0.13.0?slim=true) |

---

### Release Notes

<details>
<summary>oxc-project/tsgolint (oxlint-tsgolint)</summary>

### [`v0.13.0`](https://redirect.github.com/oxc-project/tsgolint/releases/tag/v0.13.0)

[Compare Source](https://redirect.github.com/oxc-project/tsgolint/compare/v0.12.2...v0.13.0)

#### What's Changed

- chore: update typescript-go submodule by [@&#8203;camc314](https://redirect.github.com/camc314) in [#&#8203;680](https://redirect.github.com/oxc-project/tsgolint/pull/680)
- feat: implement strict-void-return by [@&#8203;Limerio](https://redirect.github.com/Limerio) in [#&#8203;676](https://redirect.github.com/oxc-project/tsgolint/pull/676)
- feat: implement consistent-type-exports by [@&#8203;Limerio](https://redirect.github.com/Limerio) in [#&#8203;675](https://redirect.github.com/oxc-project/tsgolint/pull/675)
- feat: implement no-useless-default-assignment by [@&#8203;camc314](https://redirect.github.com/camc314) in [#&#8203;681](https://redirect.github.com/oxc-project/tsgolint/pull/681)
- fix(only-throw-error): support package allow specifiers via sourceFileToPackageName by [@&#8203;camc314](https://redirect.github.com/camc314) in [#&#8203;685](https://redirect.github.com/oxc-project/tsgolint/pull/685)

#### New Contributors

- [@&#8203;Limerio](https://redirect.github.com/Limerio) made their first contribution in [#&#8203;676](https://redirect.github.com/oxc-project/tsgolint/pull/676)

**Full Changelog**: <https://github.com/oxc-project/tsgolint/compare/v0.12.2...v0.13.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44LjUiLCJ1cGRhdGVkSW5WZXIiOiI0My44LjUiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
2026-02-15 13:03:56 +00:00
camc314 400d9e135a test(linter): add option to pass custom arguments (#19284) 2026-02-12 15:55:12 +00:00
renovate c8db8c15cb chore(deps): update dependency oxlint to v1.45.0 (#19230)
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/) |
|---|---|---|---|---|---|
| [oxlint](https://oxc.rs/docs/guide/usage/linter) ([source](https://redirect.github.com/oxc-project/oxc/tree/HEAD/npm/oxlint)) | [`1.43.0` → `1.45.0`](https://renovatebot.com/diffs/npm/oxlint/1.43.0/1.45.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/1.45.0?slim=true) | ![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/1.45.0?slim=true) | ![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/1.43.0/1.45.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/1.43.0/1.45.0?slim=true) |

---

### Release Notes

<details>
<summary>oxc-project/oxc (oxlint)</summary>

### [`v1.45.0`](https://redirect.github.com/oxc-project/oxc/blob/HEAD/npm/oxlint/CHANGELOG.md#1450---2026-02-10)

##### 🐛 Bug Fixes

- [`1b2f354`](https://redirect.github.com/oxc-project/oxc/commit/1b2f354) ci: Add missing riscv64/s390x napi targets for oxfmt and oxlint ([#&#8203;19217](https://redirect.github.com/oxc-project/oxc/issues/19217)) (Cameron)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ny4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2026-02-10 17:53:08 +00:00
camc314 d4b0324ac2 refactor(oxlint): enable useUnknownInCatchVariables tsconfig setting (#19141) 2026-02-09 13:54:38 +00:00
overlookmotel 86047f9eaf test(linter/plugins): add ability to fix suggestions in JS plugins tests (#18961)
Add ability to run `oxlint` with `--fix-suggestions` flag in tests.
2026-02-05 02:24:16 +00:00
camc314 dc51d6b24a fix(linter): normalize paths slashes for snapshots on windows (#18825) 2026-02-02 11:00:25 +00:00
connorshea 0ca6269144 fix(ci): fix the repo path normalization logic for tests on Windows. (#18815)
The previous code didn't handle normalization of paths for Windows, and so Vitest tests with snapshots that had paths were failing on Windows.

See https://github.com/oxc-project/oxc/actions/runs/21569650239/job/62146619752 for an example.

AI Disclosure: This change was made with help from Copilot + Raptor mini, and this regex is an abomination. It may be better to handle this via an additional `normalizeSlashes` call but I'm not entirely sure where to add that in this case, and I don't have a windows machine to test on.

I've also added tests with Claude, and confirmed that they work when backported to main, and so confirm the behavior has not changed on macOS (although I did have to find+replace NORMALIZED_REPO_ROOT with REPO_ROOT_PATH in the tests for that to work, but that's expected)
2026-02-02 00:13:43 +00:00
overlookmotel b002aa56a3 test(linter/plugins): add cwd option to tests (#18754)
Add a `cwd` option to tests which causes test runner to run Oxlint from within a subfolder inside a fixture dir, instead of root of the fixture dir. This is used for the test added in next PR (#18755).
2026-01-31 14:56:26 +00:00
connorshea 96ef2cced3 fix(linter): print total rule # when using a single nested config (#17517)
For a while, we've been skipping the printing of rule runs unless `--disable-nested-config` was passed. This was a result of the nested_configs value including the base config (see #16356). When we were checking whether that value was empty, it would always have at least 1 item (unless nested configs were entirely disabled).

As part of this, I've updated some configs in the fixtures to disable correctness rules, otherwise we will end up with a bunch of fixture snapshots needing updates every time a new default rule is added.

It's probably easiest to review this one commit at a time.
2025-12-31 22:56:47 +00:00
overlookmotel 9d6520e63c test(linter/plugins): add ability to lint files in deterministic order (#17205)
In JS plugins tests, it's sometimes required to ensure that files are linted in deterministic order.

For example, #17207 fixes a bug where some internal global state was not reset correctly after an error is thrown during visiting the AST. This affects what happens when linting the *next* file.

In order to write a test for this, and produces deterministic output in the snapshot file, the order files are linted in needs to be deterministic.

This PR provides this determinism by:

1. Adding a `force_deterministic_order` cargo feature which is enabled in test build.
2. When this feature is enabled *and* Oxlint is run with `--threads 1`, file paths are sorted before linting.
3. Adding an option for test fixtures `singleThread`. When `true`, the fixture is run with `--threads 1`.

Aim is to only enable deterministic ordering in test fixtures which *need* determinism, so that most test fixtures are still testing Oxlint running as it does usually for a user.
2025-12-21 14:33:13 +00:00
overlookmotel a76a42acfe test(linter/plugins): clean all file paths from test snapshots (#16972)
Fix snapshot cleaning in tests. Ensure that all file paths in snapshot are normalized.
2025-12-17 01:35:59 +00:00
overlookmotel e9ee86eb10 refactor(linter/plugins): consistently format @ts-expect-error comments (#16920)
Style nit. Format all `@ts-expect-error` comments in `apps/oxlint`. I don't know what formatting is the best, but we might as well be consistent.
2025-12-15 21:05:48 +00:00
camc314 2acd66ed42 style(all): enable eslint/curly lint rule (#16753)
built on https://github.com/oxc-project/oxc/pull/16749, we can use the linter to be consistent here
2025-12-11 14:49:48 +00:00
camc314 a5dc4c6ab6 perf(oxlint): run e2e tests concurrently (#16651)
Tests in the same file typically run in sequence. we can improve the performance by running these in parallel:

https://vitest.dev/guide/parallelism.html#test-parallelism

 - Before (sequential): ~5.2s total, e2e.test.ts ~5000ms
 - After (concurrent):  ~1.50s total, e2e.test.ts ~1200ms

~3.5x faster
2025-12-10 15:06:46 +00:00
overlookmotel af3618f0cd style(linter/plugins): prefer const to let (#16385)
Use `const` where variables are not reassigned instead of `let`. Preparation for enabling ESLint's `prefer-const` rule (running as an Oxlint JS plugin) in our linting setup.
2025-12-02 10:06:17 +00:00
Boshen 523a30a016 style(all): apply oxfmt default options (#16091)
Embrace the defaults!

---------

Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
2025-11-25 15:56:24 +09:00
overlookmotel 06f44543a2 test(linter/plugins): fix tests on Windows (#15966)
#15911 broke NAPI tests on Windows, because it failed to replace `\` with `/` in file paths in snapshots.

https://github.com/oxc-project/oxc/actions/runs/19581028169/job/56078684915#step:8:479

Fix this by normalizing slashes in file paths before outputting them in snapshots.
2025-11-22 15:05:07 +00:00
overlookmotel ca7a6d3d79 test(linter/plugins): automate testing all fixtures (#15911)
Remove the need to list every fixture in `e2e.test.ts` file by automatically running tests on every fixture in `test/fixtures` directory.

Running Oxlint with `--fix` and running fixtures with ESLint is now controlled by adding an `options.json` file to the fixture directory contining e.g. `{ "fix": true }` or `{ "eslint": true }`.

Now we can add a new fixture just by creating a new directory in `fixtures`.
2025-11-21 11:38:01 +00:00
overlookmotel c4c29a3d14 test(linter/plugins): fix test snapshots on Windows (#15451)
Follow-on after #15424. Fix the snapshots on Windows. I missed one slash!

Also, convert paths wrapped in quotes e.g. `file path: '/path/to/oxc/apps/oxlint/test/fixtures/blah/files/foo.js'`.

I've had to hack one fixture (`createOnce`) to get diagnostics to be printed in same order on all platforms. Otherwise they get printed out of order on Windows: https://github.com/oxc-project/oxc/actions/runs/19180329507/job/54835252163?pr=15451#step:8:419.

Presumably this is because on Windows the file path `D:\...` is sorted after `Cannot access`, whereas on Mac/Linux, file path `/` is sorted before `Cannot access`. However, I'm unclear why the prefixes `before hook:`, `after hook:` etc aren't included in sorting. If they were, this problem wouldn't arise.
2025-11-07 21:32:30 +00:00
overlookmotel 075079cc9c test(linter/plugins): improve reliability of replacing paths in output (#15424)
When replacing absolute paths in fixture snapshots, replace paths anywhere in the output, rather than only in certain specified patterns.

Additionally, introduce `<fixtures>` and `<fixture>` replacements to shorten paths in snapshots.

```diff
- File path: <root>/apps/oxlint/test/fixtures/fixture_name/files/1.js
+ File path: <fixture>/files/1.js
- File path: <root>/apps/oxlint/test/fixtures
+ File path: <fixtures>
```

This allows removing the `relativePath` helper function from some test plugins, outputting paths (e.g. `cwd`) anywhere, and generally will avoid problems with snapshots being system-dependent, and dependent on directory layout of fixtures.

Also, amend ESLint `stdout` output in snapshots to align all rule names, to reduce churn in snapshots, and avoid mismatches between local and CI (presumably due to differences in terminal width).

```diff
- filename: <fixture>/files/1.js                              define-plugin-plugin/create-once
- filename: <fixture>/files/long_filename.js                              define-plugin-plugin/create-once
- filename: <fixture>/files/very_long_filename.js                              define-plugin-plugin/create-once
+ filename: <fixture>/files/1.js                                 define-plugin-plugin/create-once
+ filename: <fixture>/files/long_filename.js                     define-plugin-plugin/create-once
+ filename: <fixture>/files/very_long_filename.js                define-plugin-plugin/create-once
```
2025-11-07 12:28:48 +00:00
overlookmotel fcb32ffd74 refactor(linter/plugins): use Record types (#15379)
Pure refactor. We were using a mix of `{ [key: string]: T }` and `Record<string, T>`. Standardize on `Record`.
2025-11-06 15:05:26 +00:00
leaysgur a8e5181ab7 chore(infra): dogfooding oxfmt (#14979)
Fixes #14803

- Added `oxfmt` and `oxfmtrc.jsonc`
- Remove `dprint` plugin and useless ignore paths
- Apply `dprint` again
- Apply `oxfmt`
2025-10-28 01:16:46 +00:00
camc314 ec02fe875a fix(oxlint): normalize path separators in snapshot tests (#14406)
Passing CI: https://github.com/oxc-project/oxc/actions/runs/18308879096/job/52132542984
2025-10-07 10:58:34 +00:00
camc314 28cfae0ae6 refactor(oxlint): use vitests built in file snapshot comparison (#14392)
not sure if there was a reason this had a manual impl, but vitest's implementation should handle the line ending proglems (i think)
2025-10-06 23:21:06 +00:00
overlookmotel aca083a8dc test(linter/plugins): include stderr output in snapshots (#14155)
Include `stderr` output in test snapshots. This makes sure that the "JS plugins are experimental" warning is not output if user doesn't use JS plugins.
2025-09-26 13:34:52 +00:00
overlookmotel 0029b7f218 test(linter/plugins): normalize line breaks in snapshots (#14154)
Trim leading/trailing line breaks from `stdout` in test snapshots and convert `\r\n` to `\n`. This ensures tests will pass on Windows, and removes extraneous line breaks from snapshots.
2025-09-26 12:31:19 +00:00
overlookmotel b1685f7a6a test(linter/plugins): refactor tests (#14123)
Refactor tests for Oxlint plugins. Break up snapshots into 1 per fixture directory, to make them easier to navigate.
2025-09-25 20:35:47 +00:00