@igorskyflyer/oxfmt-config
v1.2.0
Published
✨ Pixel-perfect code formatting opinions, oxfmt-powered and ready to extend. ⚓
Maintainers
Readme
Table of Contents
- ✨ Features
- 🕵🏼 Usage
- ⚙️ Implementation
- 🎯 Motivation
- 📝 Changelog
- 🪪 License
- 💖 Support
- 🧬 Related
- 👨🏻💻 Author
Features
- ✨ Consistent formatting for JS, TS, JSX, TSX, JSON, HTML, CSS, Vue and more
- 📦 Intelligent import sorting with custom internal package support
- 🎯 Opinionated but practical defaults
- ⚡ Powered by
Oxfmt(very fast Rust-based formatter) - 🛡️
Zero dependencies-oxfmtis a peer dependency only
Usage
Install it by executing any of the following, depending on the preferred package manager:
bun add -D @igorskyflyer/oxfmt-configpnpm add -D @igorskyflyer/oxfmt-configyarn add -D @igorskyflyer/oxfmt-confignpm i -D @igorskyflyer/oxfmt-configThen extend the config in .oxfmtrc.json:
.oxfmtrc.json
{ "extends": "@igorskyflyer/oxfmt-config" }Override any rule locally as needed:
.oxfmtrc.json
{
"extends": "@igorskyflyer/oxfmt-config",
"printWidth": 100,
"endOfLine": "crlf",
"arrowParens": "avoid"
}Implementation
The formatting configuration is defined in a single .oxfmtrc.json file that serves as the authoritative source of truth for all formatting decisions across the project.
All rules are intentional, documented, and designed to produce clean, readable, and diff-friendly code with minimal visual noise.
Formatting Decisions
semi: false- No semicolons. Reduces visual noise while relying on modern JavaScript ASI rules.singleQuote: true- Single quotes for strings, consistent across the entire@igorskyflyerecosystem.trailingComma: "all"- Trailing commas in all applicable places (objects, arrays, functions) for cleaner git diffs.printWidth: 80- Standard line width that balances readability and compactness.tabWidth: 2- Two-space indentation, aligned with the project’s TypeScript and EditorConfig standards.useTabs: false- Uses spaces for consistent rendering across all editors and platforms.bracketSpacing: true- Adds space inside object brackets ({ name }instead of{name}).bracketSameLine: false- Keeps the closing>of JSX elements on its own line for better visual separation.arrowParens: "always"- Always includes parentheses around arrow function parameters.objectWrap: "preserve"- Preserves intentional multi-line objects when the developer chooses to break them.singleAttributePerLine: false- Allows multiple short attributes on one line when they fit within the print width.endOfLine: "lf"andinsertFinalNewline: true- Unix line endings and final newline for POSIX compliance.jsxSingleQuote: false- Uses double quotes in JSX attributes to match HTML conventions.quoteProps: "as-needed"- Only quotes object keys when required by JavaScript syntax.embeddedLanguageFormatting: "auto",htmlWhitespaceSensitivity: "css",proseWrap: "preserve"- Sensible defaults for embedded code, HTML, and Markdown.
Import Sorting
Imports are sorted in a deliberate order optimized for human readability and debugging:
builtin- Node.js built-in modules (most familiar)internal + subpath- Internal packages including@igorskyflyer/*external- Third-party dependenciesparent + sibling + index- Relative importsstyle- Style and CSS imports (always last)unknown- Catch-all for any remaining imports
Ignored Files
node_modules/**,dist/**,coverage/**- Minified files (
*.min.js,*.min.css) - Package lockfiles (never format auto-generated files)
This configuration is applied uniformly via Oxfmt.
Motivation
Formatting decisions are a source of endless bikeshedding across projects. Each project ends up with its own slightly different config, slightly outdated, with no single source of truth.
@igorskyflyer/oxfmt-config solves this by providing one opinionated, versioned config that propagates across all projects via a simple extends.
Update once, apply everywhere - just like all packages of the @igorskyflyer ecosystem do!
Changelog
Read about the latest changes in the CHANGELOG.
License
Licensed under the MIT license.
Support
Related
This package is part of the dotfiles DX config suite - a curated index of independently installable configuration packages for linting, formatting, editing, JS/TS, React, Vue and many more.
Other related packages
@igorskyflyer/astro-render-component
🤖 Astro component renderer. Zero configuration. Produces clean HTML strings directly in Node.js without any DOM environment. 🐬
@igorskyflyer/adblock-filter-counter
🐲 A lightweight npm module for counting ad-block filter rules, ultra-simple, fast, and perfect for list maintainers, filter testers, and privacy tool developers.🦘
🧠 Zep is a zero-dependency, efficient debounce module. ⏰
🧵 An expressive and chainable library for advanced string manipulations. Supports appending, prepending, trimming, quoting, and path formatting with customizable whitespace handling. Makes advanced String manipulations a piece of cake. 🦥
🧰 Determines whether a given value can be a valid file/directory name. 🏜
Author
Created by Igor Dimitrijević (@igorskyflyer).
