An Nx plugin for oxlint — a fast ESLint alternative written in Rust.
The easiest way to set up nx-oxlint in your workspace is to use the init generator:
npx nx add nx-oxlintThis command will:
- Add
nx-oxlintas a devDependency to your workspace - Remove existing
@nx/eslint/pluginconfiguration in yournx.json - Add a plugin entry for
nx-oxlintin yournx.jsonso inferredlinttargets can be registered (see Lint target inference)
This command will not:
- Create an oxlint configuration file. Without a config file next to each
package.json/project.json, the plugin will not infer alinttarget for that directory (see Lint target inference)
You might need to update the nx daemon and cache using
nx resetThe plugin considers each workspace file that matches **/{package,project}.json (every package.json or project.json). The directory containing that file is treated as a candidate project root.
Nx merges an inferred lint target for that root only if an oxlint config file exists in the same directory. Resolution order (first match wins, and is used for Nx cache inputs and for --config when the executor runs without configFile):
.oxlintrc.jsonoxlint.config.ts.oxlintrcoxlint.json
The first two are the documented default filenames; the last two are extra fallbacks supported by this plugin.
If none of these files are present, that directory does not receive an inferred lint target. You can still add an nx-oxlint:lint target by hand in project.json or under nx / targets in package.json.
npm install nx-oxlint{
"plugins": [
{
"plugin": "nx-oxlint",
"options": {
"lintTargetName": "lint"
}
}
]
}{
"targets": {
"lint": {
"executor": "nx-oxlint:lint"
}
}
}nx run your-project:lintor
nx run-many --target lintAll options are optional. The plugin will use lint as default target
lintTargetName(optional) - target name for running oxlint, with this you can even keep using eslint as backup- All other options that the executor provides. See below
All options are optional. The executor will work with minimal configuration.
projectRoot(optional) - Project root directory (defaults to current project root)configFile(optional) - Path to the oxlint configuration file, relative to the workspace root. If omitted, the executor uses the same default filenames as the plugin. If set and the file exists, it is passed as--config. If set but the file is missing, a warning is printed and oxlint runs without--config(no fallback to the default filenames)fix(optional) - Automatically fix problems (default:false)format(optional) - Output format (default:"default")- Available formats:
checkstyle,default,github,gitlab,json,junit,stylish,unix
- Available formats:
quiet(optional) - Report errors only, disable warnings (default:false)maxWarnings(optional) - Number of warnings to trigger nonzero exit code (minimum: 0)additionalArguments(optional) - Additional arguments to pass to oxlint (e.g.,--type-awareor--type-check)
When configFile is not set on the executor, this package resolves a config in the project root using the same rule as inference and passes it to oxlint. Oxlint also supports features such as nested configs and the options described in the upstream docs.
See the Oxlint configuration guide and config file reference.