Registry / testing / broccoli-sass-lint

broccoli-sass-lint

JSON →
library1.1.2jsnpmunverified

A Broccoli plugin that provides pure Node.js scss/sass linting using sass-lint. Version 1.1.2 is the latest stable release with infrequent updates. It integrates seamlessly into Broccoli build pipelines, offering options for configuration, error handling, logging, custom test generation, and support for persistent filtering. Unlike CLI-based linters, this package is designed specifically for Broccoli-based projects.

npm install broccoli-sass-lint
INSTALL
IMPORT
SIG · BROCCOLI-SASS-LINT
B
broccoli-sass-lint
testingjavascriptv1.1.2
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.

SassLinter
const SassLinter = require('broccoli-sass-lint');
import SassLinter from 'broccoli-sass-lint';
Package is CJS only, no ESM exports
SassLinter
var SassLinter = require('broccoli-sass-lint');
import { SassLinter } from 'broccoli-sass-lint';
Default export, not named export
SassLinter
const SassLinter = require('broccoli-sass-lint');
const { default: SassLinter } = require('broccoli-sass-lint');
Do not destructure default, it's a constructor

Shows how to instantiate the linter with options and integrate into a Broccoli build

const SassLinter = require('broccoli-sass-lint'); const linter = new SassLinter('app/styles', { configPath: '.sass-lint.yml', shouldThrowExceptions: true, shouldLog: true, }); // In a Brocfile.js, export linter or use with broccoli mergeTrees const broccoli = require('broccoli'); const tree = linter; // or merge with other trees module.exports = tree;
Debug
Known issues
deprecatedsass-lint package is deprecated; consider using stylelint with scss plugin instead
fix
Migrate to stylelint-config-standard-scss and broccoli-stylelint
affects: >=0.0.0
gotchaIf shouldThrowExceptions is false, errors will not stop the build, which may lead to uncaught lint errors
fix
Set shouldThrowExceptions: true to ensure errors break the build
affects: >=0.0.0
breakingIn version 1.1.0, the constructor API changed from accepting options as first argument to accepting input tree and options
fix
Use new SassLinter(inputTree, options) instead of new SassLinter(options)
affects: >=1.1.0
Errors
Common errors & fixes
Error: Cannot find module 'sass-lint'
Missing sass-lint as a dependency
fix
Run npm install --save-dev sass-lint
TypeError: SassLinter is not a constructor
Using import instead of require, or incorrectly destructuring
fix
Use const SassLinter = require('broccoli-sass-lint');
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
sass-lintrequiredCore linting engine for SCSS/SASS files
broccoli-persistent-filteroptionalUsed for persistent caching of lint results across builds
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
broccoli-sass-lint — npm install broccoli-sass-lint · libregistry