Sass Formatter is a TypeScript-based utility for automatically formatting Sass, SCSS, CSS, and Less syntax files. It provides consistent code styling by correcting indentation, spacing, and other common formatting issues. The current stable version is 0.8.0, indicating it is still in active development with potential for minor breaking changes before a 1.0 release. It features both a programmatic API for integration into tools and a powerful command-line interface (CLI) for direct file processing and CI/CD pipelines. A key differentiator is its ability to convert CSS or SCSS to Sass syntax, alongside customizable formatting rules through a `.sassformatterrc.json` configuration file. It is notably used in the VS Code Sass extension. While a specific release cadence isn't published, the project is actively maintained with frequent updates.
npm install sass-formatterVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the `SassFormatter` class to format a Sass string programmatically and print the result.
Remove the `deleteWhitespace` key from your `.sassformatterrc.json` or custom configuration file. It may be removed in future versions.
Consult the project's changelog or GitHub releases for detailed breaking change information before upgrading to a new version.
Ensure all keys in your `.sassformatterrc.json` or custom config file adhere to the `SassFormatterConfig` interface, and that values match the expected types.
Ensure the package is installed via `npm install sass-formatter` or `yarn add sass-formatter`, and that your project supports ESM imports (e.g., set `"type": "module"` in package.json or use `.mjs` files).
Install the CLI tool globally using `npm install -g sass-formatter` or ensure `node_modules/.bin` is included in your system's PATH environment variable for local installations.
Review the specified configuration file for JSON syntax errors. Refer to the `SassFormatterConfig` interface in the documentation for valid keys and their expected value types.
No dependency data recorded yet.