Skip to content

About

📦️ High-performance, zero-config linting and formatting configuration powered by Oxlint.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Oxlint config


divider

  📦 SETUP • ⚙️ CONFIGURATION • 🛰️ FEATURES

divider


               

divider

About

High-performance, zero-config configuration package for **oxlint** and **oxfmt**, built to deliver lightning-fast linting and formatting without the overhead of traditional ESLint setups.

divider

Table of content


divider

Features

  • Blazing Fast: Powered by Oxc (written in Rust) for near-instant linting and code formatting.
  • Zero-Config DX: Out-of-the-box support for TypeScript, React, and Astro development workflows.
  • Smart Formatting: Automated import sorting, Tailwind CSS class organization, and strict code formatting via oxfmt.
  • Type-Safe: Designed specifically to integrate seamlessly with modern module bundlers and TypeScript build tools like tsdown.

  • Eslint - Linter core engine.
  • Tailwind - Organize Tailwind CSS classes effectively.
  • React - Linting support for React components.
  • Next.js - Linting support for Next.js projects.
  • Astro - Awesome Astro components linting.
  • Import - Manage imports effectively.
  • Typescript - Strong type safety for TS 6.0.
  • Unicorn - 100+ advanced modern rules.

divider

Requirements

  • node >= 22.17.0
  • bun >= 1.4.0
  • oxlint >= 1.89.0

divider

Installation

Bun

bun i -D @stacklys/oxlint-config

Npm

npm i -D @stacklys/oxlint-config

Pnpm

pnpm i -D @stacklys/oxlint-config

Yarn

yarn i -D @stacklys/oxlint-config

divider

Usage

To use @stacklys/oxlint-config, extend it in your linter configuration file. For example, in your oxlint.config.ts:

import { oxlintConfig } from '@stacklys/oxlint-config';

const config = oxlintConfig();

export default config;

If you want do use the formatter you can add the following to your oxfmt.config.ts:

import { oxfmtConfig } from '@stacklys/oxlint-config';

const config = oxfmtConfig();

export default config;

divider

Configuration

To configure @stacklys/oxlint-config, you can pass options to the oxlintConfig function in your oxlint.config.ts. For example:

import { oxlintConfig } from '@stacklys/oxlint-config';

const config = oxlintConfig({
  typescript: true,
  a11y: true,
  react: true,
  nextjs: true,
  unicorn: true,
  vitest: true,
  astro: true
});

export default config;

For configuring the formatter, you can pass options to the oxfmtConfig function in your oxfmt.config.ts. For example:

import { oxfmtConfig } from '@stacklys/oxlint-config';

const config = oxfmtConfig({
  astro: true,
  svelte: true
});

export default config;

In case you can to override or configure additional rules inside the pre-defined configuration, you can pass the object in the respective configuration functions as shown below:

import { oxlintConfig } from '@stacklys/oxlint-config';

const lintConfig = oxlintConfig(
  {
    typescript: true
  },
  {
    options: { typeAware: true },
    rules: {
      'typescript/type-annotation-spacing': 'error'
    }
  }
);

export default lintConfig;

The default configuration for oxlintConfig is the next one:

// Example of default config
import { oxlintConfig } from '@stacklys/oxlint-config';

const config = oxlintConfig({
  typescript: true,
  unicorn: true,
  vitest: true
});

export default config;

For the formatter, is the next one:

import { oxfmtConfig } from '@stacklys/oxlint-config';

const config = oxfmtConfig({
  printWidth: 180,
  tabWidth: 2,
  useTabs: false,
  semi: true,
  singleQuote: true,
  trailingComma: 'none',
  arrowParens: 'always',
  ignorePatterns: IGNORE, // Patterns to ignore during formatting
  sortPackageJson: true,
  astro: options.astro,
  bracketSameLine: false,
  bracketSpacing: true,
  endOfLine: 'lf',
  htmlWhitespaceSensitivity: 'css',
  insertFinalNewline: false,
  jsxSingleQuote: true,
  objectWrap: 'preserve',
  proseWrap: 'preserve',
  quoteProps: 'as-needed',
  singleAttributePerLine: true,
  sortTailwindcss: {
    preserveDuplicates: false
  },
  sortImports: {
    newlinesBetween: true,
    partitionByNewline: false,
    internalPattern: ['~/', '@/', '@', '#'],
    groups: [
      'index',
      'sibling',
      'parent',
      'subpath',
      'internal',
      'builtin',
      'external',
      'import',
      'type',
      'side_effect_style',
      'side_effect',
      'style'
    ]
  },
  svelte: Boolean(options.svelte),
  vueIndentScriptAndStyle: true
});

export default config;

divider

  BACK TO TOP

divider

  Copyright © All rights reserved,
  developed by Luis Monsalve and

About

📦️ High-performance, zero-config linting and formatting configuration powered by Oxlint.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages