✨ Formatters made to work with std in/out (useful for IDEs) and some helpful additional config.
This package provides stdin/stdout wrappers for popular code formatters, making them easy to integrate with IDEs and text editors. Each formatter is designed to read from stdin and output to stdout, enabling seamless integration with editor formatting workflows.
bun add @mostlyserious/formatters --globalPHP code formatter using Laravel Pint.
Usage:
echo "<?php echo 'hello world';" | std-pintFeatures:
- Auto-installs Laravel Pint via Composer if not present
- Processes PHP code from stdin
- Returns formatted code to stdout
- Supports all Pint command-line options
Tailwind CSS class sorter using rustywind.
Usage:
# Default HTML/JSX processing
echo '<div class="p-4 bg-red-500 text-white">' | std-rustywind
# CSS processing (for @apply directives)
echo '@apply p-4 bg-red-500 text-white;' | std-rustywind css
# JavaScript processing
echo "el.setAttribute('class', 'p-4 bg-red-500 text-white')" | std-rustywind js
# Svelte processing
echo '<div class="p-4 bg-red-500 text-white"></div><style> .selector { @apply p-4 bg-red-500 text-white; } </style>' | std-rustywind svelteFeatures:
- Auto-installs rustywind via Homebrew if not present
- Supports multiple file types with custom regex patterns
- Handles CSS
@applydirectives, JavaScript class attributes, and Svelte components
CSS/SCSS linter and formatter using Stylelint.
Usage:
# Standard CSS/SCSS
echo 'body { color: red; }' | std-stylelint
# HTML with embedded CSS
echo '<style>body { color: red; }</style>' | std-stylelint htmlFeatures:
- Auto-installs Stylelint and postcss-html via Bun if not present
- Auto-generates
stylelint.config.jswith sensible defaults if missing - Supports HTML processing with embedded CSS
- Automatically fixes formatting issues
These formatters are designed to work seamlessly with IDE formatting features:
- Configure your IDE to use the appropriate
std-*command as a formatter - Set the formatter to read from stdin and write to stdout
- The formatter will handle dependency installation automatically