@zgeoff/oxlint-config
v0.10.7
Published
Shareable oxlint config: strict categories, house-style rules, and a custom JS plugin
Readme
Shareable oxlint config: every category at error,
restriction-rule cherry-picks, comment-style enforcement via @stylistic, and a bundled JS plugin
(zgeoff/* rules) banning shapes no native oxlint rule can express — top-level arrows, nested
function declarations, bare named exports, destructured and inline-typed parameters, ternary and
await arguments, awaits hidden inside a control-flow condition or a &&/||/?? chain, every
switch statement, every JSDoc block, any run of more than three line comments, a type claim with
no as, and a repo config that loosens a comment rule or a type-assertion rule.
Install
bun add -d @zgeoff/oxlint-config oxlint @stylistic/eslint-pluginExtend it from .oxlintrc.json — extends resolves file paths only, so point at the file inside
node_modules:
{
"extends": ["./node_modules/@zgeoff/oxlint-config/oxlintrc.json"],
// ignorePatterns don't propagate through extends — each consumer declares
// its own (oxlint also honors .gitignore)
"ignorePatterns": ["**/node_modules/**", "**/dist/**", "**/*.json"],
}Or import the config object in oxlint.config.ts:
import config from '@zgeoff/oxlint-config';A repo with React extends ./node_modules/@zgeoff/oxlint-config/react.json after the base config.
The React overlay says what it
changes.
The plugin is addressable on its own at @zgeoff/oxlint-config/plugin for configs that want the
zgeoff/* rules without the rest.
Plugins and type-aware rules
- The config enables the
typescript,unicorn,oxc,import, andpromiseplugins and loads@stylistic/eslint-pluginthroughjsPlugins. oxlint resolvesjsPluginsspecifiers from the project root, not from the config file that names them — so@stylistic/eslint-pluginmust be a direct dependency of the consuming project. Hoisting package managers (bun's default linker, npm) resolve it transitively anyway, but isolated layouts (pnpm,bun install --linker isolated) fail withCannot find module '@stylistic/eslint-plugin'unless it's installed directly. - Type-aware rules activate under
oxlint --type-aware, which needs a type-aware backend: installoxlint-tsgolint, or install@maschwenk/tsrslintand setOXLINT_TSGOLINT_PATHto the path that itstsrslint-pathcommand prints. The config works without a backend.
Rules
- Type assertions: every
asother thanas constfails, andzgeoff/no-hidden-castreports a type claim with noas. See type assertions. - Comments:
zgeoff/no-jsdocandzgeoff/max-consecutive-line-commentskeep comments to the reason for a line. See the comment rules. - Code style: function verbs, verb contracts, module order, file names, abbreviated names and classes. See code-style rules.
- Test files: a test sits beside its module, holds only
setupTest()and its tests, uses inline snapshots, keeps each timeout within its lane's limit, and waits on a condition, never a sleep. See test-file rules. - Seeding: test code writes database rows only where the testing skill's seeding rules allow, and each seed has a test beside it. See seeding rules.
- Require functions:
zgeoff/no-requirebans therequireglobal andcreateRequire, andimport/no-commonjsbans CommonJS exports. See require functions. - Import boundaries:
zgeoff/import-zonesfails an import that crosses a declared zone boundary. See import zones. - Feature folders:
zgeoff/feature-folderscaps the loose modules at the root of a package'ssrc/, and keeps shared code insrc/utils/. See feature folders.
Configuration
Every rule runs as the config ships it, and zgeoff/no-comment-rule-override keeps a repo from
loosening the comment and type-assertion rules. zgeoff/no-restricted-words and
zgeoff/import-zones stay off until a repo configures them;
the config overview and
import zones hold their options.
Documentation
The oxlint-config docs explain each rule.
