📦 SETUP • ⚙️ CONFIGURATION • 🛰️ FEATURES
| 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. |
- 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.
bun i -D @stacklys/oxlint-confignpm i -D @stacklys/oxlint-configpnpm i -D @stacklys/oxlint-configyarn i -D @stacklys/oxlint-configTo 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;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;BACK TO TOP
Copyright © All rights reserved, developed by Luis Monsalve and