@genesislcap/oxlint-config
v14.467.0
Published
Oxlint rules derived from @genesislcap/eslint-config and eslint.config.mjs
Readme
@genesislcap/oxlint-config
Published Oxlint rules for Genesis Foundation UI. It is the lint analogue of @genesislcap/eslint-config: one shared ruleset apps and the monorepo extend, while ESLint stays available for stricter or type-aware checks that Oxlint does not cover.
What it does
- Ships
.oxlintrc.json— the only file you should edit for Oxlint rule changes in this product line. - Keeps rule intent aligned with
@genesislcap/eslint-configand the monorepo rooteslint.config.mjs(ESLint-only overrides stay in ESLint). - Does not format code. Formatting is Oxfmt — config lives in the root
.oxfmtrc.json(copy it to your app, no extra package needed).
How it runs in the monorepo
npm run lint/genx lintruns Oxlint (first, before Oxfmt and Stylelint) from the current working directory.- The repo root has a small
.oxlintrc.jsonthat onlyextendsthis package sooxlintfinds the same rules from the workspace root. - Nested apps that run
genx lintfrom their own folder may need a local stubextends(see Consumption) so config resolves correctly.
Import rules and ESLint
Oxlint loads eslint-plugin-import as a JS plugin under the alias import-es (avoids clashing with Oxlint’s built-in import plugin). In this config, import-es covers newline-after-import, no-self-import, no-useless-path-segments (warn), and no-duplicates (warn).
Import ordering is handled by import-es/order with the same groups and alphabetize config as @genesislcap/eslint-config, so both linters enforce identical ordering. import-es/first is disabled (redundant with import-es/order).
import/no-extraneous-dependencies is intentionally not run in Oxlint here (noisy with per-package package.json in a large monorepo). Use ESLint for that.
Native Oxlint import/* rules used here include no-absolute-path and no-mutable-exports — do not duplicate those as import-es/*.
JS plugins are alpha in Oxlint; type-aware TypeScript rules still require ESLint (upstream limits).
When to run ESLint as well: use genx lint -l eslint or, from the monorepo root, npm run lint:with-eslint, when you need import/no-extraneous-dependencies, finer import/* behavior, or @typescript-eslint/* type-aware rules.
Consumption
In this repository: change rules only in this package’s .oxlintrc.json. Keep the root stub in sync with the extends pattern below.
Downstream: installing @genesislcap/oxlint-config automatically brings in oxlint, oxfmt, and the required ESLint plugins as bundled dependencies — no separate installs needed. At your app root, add:
{
"devDependencies": {
"@genesislcap/oxlint-config": "latest"
}
}Then create .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["./node_modules/@genesislcap/oxlint-config/.oxlintrc.json"]
}And copy .oxfmtrc.json from the foundation-ui repo for Oxfmt config (no extra package needed).
If you run Oxlint only from a subfolder of a monorepo, ensure a .oxlintrc.json in that folder can resolve the shared config (for example by extending a path or package that exists from that directory).
Bundled dependencies
Shipped as dependencies in package.json so they install automatically:
oxlintoxfmteslint-import-resolver-typescripteslint-plugin-importeslint-plugin-unused-imports
