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 configuration for
nx-oxlintwith an interferredlinttarget to yournx.json
This command will not:
- Create an
.oxlintrc.json, so runninglintwill use the default config. Feel free to add a config file and modify the rules as needed
You might need to update the nx deamon and cache using
nx resetnpm 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 oxlint configuration file (auto-detected by oxlint if not specified, if specified other config files are ignored)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)
If no config file is passed to the plugin/executor, Oxlint will automatically look for configuration files and even consider nested configs with name .oxlintrc.json
See oxlint documentation for configuration options.