From a278ae232629eedf610125018e367d2dd5acdfcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Sat, 10 Oct 2026 12:46:28 +0100 Subject: [PATCH 1/9] feat: add @tanstack/oxlint-config Port of @tanstack/eslint-config to Oxlint. Uses native Oxlint rules where they exist, and loads eslint-plugin-import-x (import/order), @stylistic/eslint-plugin (spaced-comment) and a local `tanstack` plugin (type-parameter-naming, replacing @typescript-eslint/naming-convention) as JS plugins resolved from the package, so consumers don't install them. no-octal is not ported, as Oxlint does not implement it. Co-Authored-By: Claude Opus 5.5 --- .changeset/add-oxlint-config.md | 5 + docs/config.json | 4 + docs/overview.md | 1 + docs/oxlint.md | 60 +++++ nx.json | 3 + package.json | 5 +- packages/oxlint-config/oxlint.config.ts | 8 + packages/oxlint-config/package.json | 58 +++++ packages/oxlint-config/src/import.ts | 39 +++ packages/oxlint-config/src/index.ts | 66 +++++ packages/oxlint-config/src/javascript.ts | 61 +++++ packages/oxlint-config/src/node.ts | 12 + packages/oxlint-config/src/plugin.ts | 49 ++++ packages/oxlint-config/src/stylistic.ts | 12 + packages/oxlint-config/src/typescript.ts | 61 +++++ packages/oxlint-config/tsconfig.json | 8 + packages/oxlint-config/tsdown.config.ts | 23 ++ pnpm-lock.yaml | 310 +++++++++++++++++++++++ pnpm-workspace.yaml | 3 + 19 files changed, 786 insertions(+), 2 deletions(-) create mode 100644 .changeset/add-oxlint-config.md create mode 100644 docs/oxlint.md create mode 100644 packages/oxlint-config/oxlint.config.ts create mode 100644 packages/oxlint-config/package.json create mode 100644 packages/oxlint-config/src/import.ts create mode 100644 packages/oxlint-config/src/index.ts create mode 100644 packages/oxlint-config/src/javascript.ts create mode 100644 packages/oxlint-config/src/node.ts create mode 100644 packages/oxlint-config/src/plugin.ts create mode 100644 packages/oxlint-config/src/stylistic.ts create mode 100644 packages/oxlint-config/src/typescript.ts create mode 100644 packages/oxlint-config/tsconfig.json create mode 100644 packages/oxlint-config/tsdown.config.ts diff --git a/.changeset/add-oxlint-config.md b/.changeset/add-oxlint-config.md new file mode 100644 index 00000000..ea3c212f --- /dev/null +++ b/.changeset/add-oxlint-config.md @@ -0,0 +1,5 @@ +--- +'@tanstack/oxlint-config': minor +--- + +Add `@tanstack/oxlint-config`, a port of `@tanstack/eslint-config` to Oxlint diff --git a/docs/config.json b/docs/config.json index bb64be21..0b6efb8b 100644 --- a/docs/config.json +++ b/docs/config.json @@ -22,6 +22,10 @@ "label": "ESLint", "to": "eslint" }, + { + "label": "Oxlint", + "to": "oxlint" + }, { "label": "Publish", "to": "publish" diff --git a/docs/overview.md b/docs/overview.md index 21fa061e..1b25ee00 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -19,6 +19,7 @@ The following tools are required to use these packages: ## Utilities - [ESLint](./eslint.md) +- [Oxlint](./oxlint.md) - [Publish](./publish.md) - [Vite](./vite.md) diff --git a/docs/oxlint.md b/docs/oxlint.md new file mode 100644 index 00000000..22d70d57 --- /dev/null +++ b/docs/oxlint.md @@ -0,0 +1,60 @@ +--- +id: oxlint +title: Oxlint +--- + +## Purpose + +This package is a port of the [shared ESLint config](./eslint.md) to [Oxlint](https://oxc.rs/docs/guide/usage/linter). It enables the same rules, using Oxlint's native rules where they exist, and runs the rest as JS plugins. Like the ESLint config, it is framework-agnostic. + +## Installation + +To install the package, run the following command: + +```bash +pnpm add -D @tanstack/oxlint-config oxlint oxlint-tsgolint +``` + +## Setup + +### package.json + +- Make sure you have Oxlint v1.87+ installed +- `oxlint-tsgolint` is required, as the config enables type-aware linting + +### oxlint.config.ts + +```ts +import { tanstackConfig } from '@tanstack/oxlint-config' +import { defineConfig } from 'oxlint' + +export default defineConfig({ + extends: [tanstackConfig], + // Not inherited through `extends` + env: tanstackConfig.env, + ignorePatterns: tanstackConfig.ignorePatterns, + rules: { + // Custom rules go here + }, +}) +``` + +Oxlint does not inherit `env`, `ignorePatterns` or `settings` through `extends`, so pass `env` and `ignorePatterns` through as shown. Rules, plugins, JS plugins, categories and options are inherited. + +## Differences from the ESLint config + +- `no-octal` is not enabled, because Oxlint does not implement it. Legacy octal literals are already a syntax error in ES modules. +- `@typescript-eslint/naming-convention` is replaced by `tanstack/type-parameter-naming`, which enforces the same type parameter pattern. +- `import/order` runs from `eslint-plugin-import-x` under the `import-js` name, and `n/prefer-node-protocol` is replaced by `unicorn/prefer-node-protocol`. +- The rules apply to every file Oxlint lints, not only `*.{js,ts,tsx}` and `*.vue`. Oxlint only lints the `