Skip to content

oxlint-config

Build npm version

@rnx-kit/oxlint-config is a set of configurations that can be used as is, or extended in your own oxlint config.

yarn add @rnx-kit/oxlint-config --dev

or if you’re using npm:

npm add --save-dev @rnx-kit/oxlint-config

Several configurations are exported by this package. For instance, to use the recommended configuration, you can re-export it in your config like so:

export { default } from "@rnx-kit/oxlint-config";

Alternatively, if you want to add customizations:

import recommended from "@rnx-kit/oxlint-config";
import { defineConfig } from "oxlint";
export default defineConfig({
extends: [recommended],
plugins: ["import"],
rules: {
"import/no-default-export": "error",
"no-unneeded-ternary": "error",
},
});

Additionally, we also export the following configurations to ease the migration from ESLint:

  • ✓: Enabled with @rnx-kit/oxlint-config/recommended
  • 🔧: Fixable with --fix
✓ 🔧 Rule Description
✓ @rnx-kit/no-const-enum disallow const enum (why is it bad?)
✓ 🔧 @rnx-kit/no-export-all disallow export * (why is it bad?)
✓ @rnx-kit/no-foreach-with-captured-variables disallow forEach with outside variables; JavaScript is not efficient when it comes to using variables defined outside of its scope, and repeatedly calling that function can lead to performance issues. By using a for...of loop, you can avoid these performance pitfalls and also it is easier to debug.
@rnx-kit/type-definitions-only disallow anything but type definitions; useful for types only files or packages