diff --git a/astro-docs/sidebar.mts b/astro-docs/sidebar.mts index 2fd1ae6591ee22..5648b5785b9014 100644 --- a/astro-docs/sidebar.mts +++ b/astro-docs/sidebar.mts @@ -446,6 +446,7 @@ const technologiesGroups: SidebarItems = [ link: 'technologies/module-federation/introduction', }, { label: 'ESLint', link: 'technologies/eslint/introduction' }, + { label: 'Oxlint', link: 'technologies/oxlint/introduction' }, ], }, { @@ -967,6 +968,11 @@ const knowledgeBaseGroups: SidebarItems = [ ...getTechnologyKBItems('eslint-plugin', 'eslint'), ], }, + { + label: 'Oxlint', + collapsed: true, + items: [...getTechnologyKBItems('oxlint')], + }, { label: 'Vite', collapsed: true, @@ -1103,6 +1109,11 @@ const referenceGroups: SidebarItems = [ ...getTechnologyAPIItems('eslint-plugin', 'eslint', 'ESLint Plugin'), ], }, + { + label: 'Oxlint', + collapsed: true, + items: [...getTechnologyAPIItems('oxlint', undefined, 'Oxlint')], + }, { label: 'Webpack', collapsed: true, diff --git a/astro-docs/src/content/docs/features/enforce-module-boundaries.mdoc b/astro-docs/src/content/docs/features/enforce-module-boundaries.mdoc index e565c343c669eb..c26e774035f5f3 100644 --- a/astro-docs/src/content/docs/features/enforce-module-boundaries.mdoc +++ b/astro-docs/src/content/docs/features/enforce-module-boundaries.mdoc @@ -196,6 +196,11 @@ tagged with "scoped:shared" or "scope:admin". Read more about [ESLint rule options](/docs/technologies/eslint/eslint-plugin/guides/enforce-module-boundaries). +{% /tabitem %} +{% tabitem label="Oxlint" %} + +If you're using `@nx/oxlint` instead of ESLint, configure `@nx/oxlint/boundaries-plugin` and `@nx/enforce-module-boundaries` in `.oxlintrc.json` (see [Oxlint module boundaries bridge](/docs/technologies/oxlint/introduction#experimental-module-boundaries-bridge)). + {% /tabitem %} {% tabitem label="Conformance" %} diff --git a/astro-docs/src/content/docs/knowledge-base/oxlint/index.mdoc b/astro-docs/src/content/docs/knowledge-base/oxlint/index.mdoc new file mode 100644 index 00000000000000..995a0adc7b94fc --- /dev/null +++ b/astro-docs/src/content/docs/knowledge-base/oxlint/index.mdoc @@ -0,0 +1,9 @@ +--- +title: Oxlint +description: Oxlint guides and best practices for Nx workspaces +sidebar: + hidden: true +pagefind: false +--- + +{% sidebar_group_cards group="Knowledge Base/Oxlint" /%} diff --git a/astro-docs/src/content/docs/technologies/oxlint/index.mdoc b/astro-docs/src/content/docs/technologies/oxlint/index.mdoc new file mode 100644 index 00000000000000..7c99eaad1f1b82 --- /dev/null +++ b/astro-docs/src/content/docs/technologies/oxlint/index.mdoc @@ -0,0 +1,9 @@ +--- +title: Oxlint +sidebar: + hidden: true +description: Guides and API references for Oxlint in Nx +pagefind: false +--- + +{% index_page_cards path="technologies/oxlint" /%} diff --git a/astro-docs/src/content/docs/technologies/oxlint/introduction.mdoc b/astro-docs/src/content/docs/technologies/oxlint/introduction.mdoc new file mode 100644 index 00000000000000..6596394bc3eda4 --- /dev/null +++ b/astro-docs/src/content/docs/technologies/oxlint/introduction.mdoc @@ -0,0 +1,111 @@ +--- +title: Oxlint Plugin for Nx +description: Learn how to set up and use the @nx/oxlint plugin with inferred tasks, hybrid migration, and experimental module-boundary enforcement. +sidebar: + label: Introduction +filter: 'type:References' +--- + +The `@nx/oxlint` plugin integrates [Oxlint](https://oxc.rs/docs/guide/usage/linter/) with Nx for fast lint execution in monorepos. + +## Experimental status + +{% aside type="note" title="Experimental" %} +`@nx/oxlint` and the Oxlint JS-plugin boundary bridge are experimental. +The feature set may evolve quickly while Oxlint JS plugins are still stabilizing. +{% /aside %} + +## Setup + +Install the plugin: + +```shell +nx add @nx/oxlint +``` + +This registers `@nx/oxlint/plugin` (when inference plugins are enabled), installs `oxlint`, and creates a root `.oxlintrc.json` if needed. + +## Inferred tasks + +`@nx/oxlint/plugin` infers tasks from Oxlint config files: + +- `.oxlintrc.json` +- `.oxlintrc.jsonc` +- `oxlint.config.ts` + +The plugin infers command-based targets and configures caching using Nx inputs. + +You can view inferred tasks with: + +```shell +nx show project my-project --web +``` + +## Target naming in hybrid workspaces + +For mixed ESLint + Oxlint workspaces, Nx attempts to avoid target collisions. +When adding the plugin, it tries target names in this order: + +1. `lint` +2. `oxlint` +3. `oxlint:lint` +4. `oxlint-lint` + +This enables incremental migration without removing ESLint. + +## Explicit target fallback + +If `useInferencePlugins` is disabled, use explicit targets with `@nx/oxlint:lint`: + +```json +{ + "targets": { + "oxlint": { + "executor": "@nx/oxlint:lint", + "options": { + "lintFilePatterns": ["{projectRoot}"] + } + } + } +} +``` + +## Hybrid migration from ESLint + +Use the migration helper to register Oxlint while keeping ESLint targets intact: + +```shell +nx g @nx/oxlint:convert-from-eslint +``` + +By default this adds an `oxlint` target per converted project and leaves existing ESLint configuration untouched. + +For hybrid setups that still run ESLint for some checks, you can optionally use `eslint-plugin-oxlint` to reduce overlap while migrating. + +## Experimental module boundaries bridge + +`@nx/oxlint` exposes an experimental JS-plugin bridge at `@nx/oxlint/boundaries-plugin`. +It reuses Nx project-graph-aware `enforce-module-boundaries` logic from `@nx/eslint-plugin`. + +Example config snippet: + +```json +{ + "jsPlugins": [ + { + "name": "@nx", + "specifier": "@nx/oxlint/boundaries-plugin" + } + ], + "rules": { + "@nx/enforce-module-boundaries": [ + "error", + { + "depConstraints": [] + } + ] + } +} +``` + +This path is intended for early adopters and may change. diff --git a/astro-docs/src/plugins/utils/plugin-mappings.ts b/astro-docs/src/plugins/utils/plugin-mappings.ts index e248b2ed48f1d5..157b059a1eb41d 100644 --- a/astro-docs/src/plugins/utils/plugin-mappings.ts +++ b/astro-docs/src/plugins/utils/plugin-mappings.ts @@ -40,6 +40,8 @@ export const pluginToTechnology: Record = { eslint: 'eslint', 'eslint-plugin': 'eslint', + oxlint: 'oxlint', + webpack: 'build-tools', vite: 'build-tools', rollup: 'build-tools',