oxlint
Introduction
This package provides the shared oxlint configuration for the entire FRAME monorepo. Its goal is to guarantee consistency in static analysis, code quality, and convention compliance across all applications and packages.
Package architecture
Section titled “Package architecture”The package exposes a single root configuration from src/base.ts, which groups four plugin layers applied via overrides according to file type:
graph TD A[base.ts] --> B[TypeScript Plugin] A --> C["Overrides *.cjs/*.cts"] A --> D["Overrides *.ts/*.tsx"] A --> E["Overrides *.js/*.jsx/*.ts/*.tsx"] E --> F[eslint-plugin-import] E --> G[eslint-plugin-perfectionist] E --> H[eslint-plugin-sonarjs] E --> I[eslint-plugin-unicorn] E --> J["@tanstack/eslint-plugin-query"] E --> K[eslint-plugin-check-file]
Included plugins
Section titled “Included plugins”| Plugin | Purpose |
|---|---|
typescript | Static analysis rules for TypeScript |
eslint-plugin-import | Validation of import/export declarations |
eslint-plugin-perfectionist | Consistent ordering of imports, exports, objects, JSX props |
eslint-plugin-sonarjs | Bug and code-smell detection in the SonarQube style |
eslint-plugin-unicorn | Modern JavaScript/TypeScript best practices |
@tanstack/eslint-plugin-query | Rules specific to TanStack Query |
eslint-plugin-check-file | File and folder naming conventions |
oxlint-tsgolint | Additional TypeScript rules via oxlint |
Ignored patterns
Section titled “Ignored patterns”The configuration automatically excludes the following build directories and files:
**/node_modules/****/.next/****/out/****/build/****/public/****/dist/****/coverage/****/.turbo/****/pnpm-lock.yaml**/yarn.lock**/package-lock.jsonNotable rules
Section titled “Notable rules”TypeScript
Section titled “TypeScript”| Rule | Level |
|---|---|
@typescript-eslint/no-explicit-any | error |
@typescript-eslint/no-namespace | error |
@typescript-eslint/ban-ts-comment | error |
@typescript-eslint/consistent-type-imports | warn |
@typescript-eslint/no-unsafe-declaration-merging | error |
Imports and exports
Section titled “Imports and exports”| Rule | Level |
|---|---|
import/no-duplicates | error |
import/no-commonjs | error |
import/no-dynamic-require | error |
import/no-absolute-path | error |
perfectionist/sort-exports | warn |
perfectionist/sort-import-attributes | error |
Unicorn (best practices)
Section titled “Unicorn (best practices)”| Rule | Level |
|---|---|
unicorn/filename-case | error (kebab-case) |
unicorn/no-null | error |
unicorn/prefer-node-protocol | error |
unicorn/prefer-top-level-await | error |
unicorn/no-array-for-each | error |
How to use it in a new package
Section titled “How to use it in a new package”- Add the package as a development dependency:
package.json {"devDependencies": {"@frame/oxlint": "workspace:*"}} - Create an
oxlint.config.tsfile at the package root:oxlint.config.ts import base from "@frame/oxlint/base"export default {...base,// override or extend rules as needed} - Run lint manually:
Terminal window pnpm -F <package-name> lint
3. Add the lint script to `package.json`:```json title="package.json"{ "scripts": { "lint": "oxlint --fix" }}File naming conventions
Section titled “File naming conventions”The check-file/folder-naming-convention rule enforces kebab-case in the following directories:
| Directory | Convention |
|---|---|
content/** | KEBAB_CASE |
e2e/** | KEBAB_CASE |