Skip to content

Repository files navigation

@ivosabev/config

Oxlint, Oxfmt, and TypeScript configs

This makes assumptions about the way you prefer to develop software and gives you configurations that will actually help you in your development.

Install

npm install @ivosabev/config
yarn add @ivosabev/config
pnpm add @ivosabev/config

Usage

Oxfmt (Formatter)

Create an .oxfmtrc.json file in your project root that extends the shared config:

{
  "$schema": "./node_modules/oxfmt/configuration_schema.json",
  "printWidth": 140,
  "singleQuote": true,
  "bracketSpacing": false
}

Or copy the config from @ivosabev/config/oxfmt and customize as needed.

Customizing Oxfmt

Copy node_modules/@ivosabev/config/oxfmt.json to your project root as .oxfmtrc.json and modify it. See the Oxfmt config reference for all available options.

Oxlint (Linter)

Create an .oxlintrc.json file in your project root:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "extends": ["@ivosabev/config/oxlint"]
}

Or copy the config from @ivosabev/config/oxlint and customize as needed.

Customizing Oxlint

Copy node_modules/@ivosabev/config/oxlint.json to your project root as .oxlintrc.json and modify it. See the Oxlint config reference for all available options.

TypeScript

Create a tsconfig.json file in your project root with the following content:

{
  "extends": "@ivosabev/config/typescript",
  "include": ["@ivosabev/config/reset.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
  "compilerOptions": {
    "paths": {
      "#app/*": ["./app/*"],
      "#tests/*": ["./tests/*"]
    }
  }
}

If you want to build with tsc create a tsconfig.build.json file in your project root with the following content:

{
  "extends": "@ivosabev/config/typescript/build",
  "include": ["@ivosabev/config/reset.d.ts", "src", "tailwind.config.ts"],
  "compilerOptions": {
    "declarationDir": "dist/dts",
    "outDir": "dist/esm",
    "tsBuildInfoFile": ".tsbuildinfo/build.tsbuildinfo"
  }
}
Customizing TypeScript

Learn more from the TypeScript docs here.

package.json

You may want to add the following scripts to your project:

{
  "fmt": "oxfmt",
  "fmt:check": "oxfmt --check",
  "lint": "oxlint",
  "lint-check": "oxlint",
  "typecheck": "tsc",
  "validate": "run-p -l lint fmt:check typecheck"
}

Migration from ESLint/Prettier

This package previously used ESLint and Prettier. It now uses Oxlint and Oxfmt from the Oxc project.

See unsupported.md for a list of rules and features that could not be directly migrated.

Credits

License

MIT

About

ESLint Configuration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages