Registry / testing / sass-lint-format-scss-lint

sass-lint-format-scss-lint

JSON →
library1.1.0jsnpmunverified

A formatter plugin for sass-lint that reproduces the default output style of scss-lint. Version 1.1.0 is the latest stable release. Requires sass-lint >= 2.0.0. This package is specifically designed for users migrating from scss-lint to sass-lint who want to maintain the same CLI output format. It is a simple adapter that transforms sass-lint's results into scss-lint's format string. No active development expected; primarily used in legacy projects.

npm install sass-lint-format-scss-lint
INSTALL
IMPORT
SIG · SASS-LINT-FORMAT-S
S
sass-lint-format-scss-lint
testingjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import formatter from 'sass-lint-format-scss-lint';
const formatter = require('sass-lint-format-scss-lint');
CommonJS require works in Node.js environments; ESM import is also valid as the package provides a default export.
format
const format = require('sass-lint-format-scss-lint');
import { format } from 'sass-lint-format-scss-lint';
The package exports a single default function; there is no named export 'format'.
use as sass-lint formatter
const sassLint = require('sass-lint'); const formatter = require('sass-lint-format-scss-lint'); sassLint.lintFiles({options}).then(results => console.log(formatter(results)));
sassLint.lintFiles({options}, {formatter: 'scss-lint'});
The formatter is not integrated into sass-lint's built-in formatter options; it must be applied manually to the results object.

Shows how to use the formatter to convert sass-lint results to scss-lint style output.

const sassLint = require('sass-lint'); const formatter = require('sass-lint-format-scss-lint'); const files = ['src/**/*.scss']; const options = { options: { formatter: 'stylish', // default, but we override manually cache: false, }, files: { include: files }, }; sassLint.lintFiles(options) .then(results => { const output = formatter(results); console.log(output); }) .catch(err => console.error(err));
Debug
Known issues
gotchaThe formatter expects the result object from sass-lint.lintFiles() directly; passing an array or modified object may cause errors.
fix
Ensure you pass the exact results object returned by sass-lint.lintFiles() (the raw output).
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'sass-lint-format-scss-lint'
Package not installed or not in node_modules.
fix
Run 'npm install sass-lint-format-scss-lint' (or 'yarn add' / 'pnpm add').
TypeError: formatter is not a function
Incorrect import style; using destructuring on a default export that is a function.
fix
Use 'const formatter = require('sass-lint-format-scss-lint');' (CommonJS) or 'import formatter from ...' (ESM).
sass-lint is not a function
Using outdated or incorrect sass-lint API (require('sass-lint') returns an object with methods, not a function).
fix
Use 'sassLint = require('sass-lint');' then invoke 'sassLint.lintFiles()' or 'sassLint.lintText()'.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
sass-lint-format-scss-lint — npm install sass-lint-format-scss-lint · libregistry