sass-lint-brunch
raw JSON → 1.1.0 verified Fri May 01 auth: no javascript
sass-lint-brunch is a Brunch plugin that integrates sass-lint, a Node.js-based SCSS/SASS linter, into Brunch's build pipeline. Version 1.1.0 is the current stable release with no recent updates. It automatically lints all SCSS/SASS files during compilation, respecting Brunch's underscore-prefix ignore rule. Configuration is done via brunch-config.js, supporting custom sass-lint config files, options passthrough, and a warn-only mode to avoid breaking builds. Compared to alternatives like sass-lint-auto-fix, this plugin is minimal and focused on linting alone, with no auto-fix support.
Common errors
error Error: Cannot find module 'sass-lint' ↓
cause sass-lint is not installed as a dependency.
fix
Run 'npm install --save-dev sass-lint' to install the peer dependency.
error Plugin sassLintBrunch is not a valid plugin ↓
cause Plugin not properly configured in brunch-config.js.
fix
Ensure the plugins section uses the correct key 'sassLint' as shown in the README.
Warnings
deprecated sass-lint is deprecated in favor of stylelint ↓
fix Switch to stylelint with the appropriate Brunch plugin (e.g., stylelint-brunch) and migrate your sass-lint config.
gotcha Brunch ignores files starting with '_' by default; linting may not run on partial files ↓
fix Ensure you are not relying on linting partial files; rename them if necessary.
breaking Requires Node.js >= 4, which is EOL; may fail on newer Node versions ↓
fix Upgrade Node.js or consider alternative tools.
Install
npm install sass-lint-brunch yarn add sass-lint-brunch pnpm add sass-lint-brunch Imports
- sassLintBrunch wrong
const sassLintBrunch = require('sass-lint-brunch')correctimport sassLintBrunch from 'sass-lint-brunch'
Quickstart
npm install --save-dev sass-lint-brunch sass-lint
// In brunch-config.js:
module.exports = {
plugins: {
sassLint: {
options: {
rules: {
'no-ids': 2,
'no-important': 1
}
},
warnOnly: false
}
}
};