Registry / testing / scss-lint-loader

scss-lint-loader

JSON →
library1.0.1jsnpmunverified

Webpack loader that runs scss-lint to enforce SCSS best practices. This package (v1.0.1) is a thin wrapper around scss-lint, with no active development since 2017. It lacks support for modern Webpack 5+, and scss-lint itself was deprecated and replaced by stylelint. Use 'stylelint-webpack-plugin' instead. Release cadence: no releases since initial 1.0.0/1.0.1.

npm install scss-lint-loader
INSTALL
IMPORT
SIG · SCSS-LINT-LOADER
S
scss-lint-loader
testingjavascriptv1.0.1
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
module.exports = { module: { rules: [{ test: /\.scss$/, loader: 'scss-lint-loader' }] } }
const scssLintLoader = require('scss-lint-loader');
scss-lint-loader is used as a Webpack loader via configuration, not imported directly.
config
/* webpack.config.js */ { test: /\.scss$/, loader: 'scss-lint-loader', options: { config: '.scss-lint.yml' } }
Options are passed via Webpack's options object.
use
module.exports = { module: { rules: [{ test: /\.scss$/, use: ['scss-lint-loader'] }] } }
Can also use 'use' syntax with array.

Shows how to configure scss-lint-loader in Webpack to lint SCSS files using a custom config file and fail on errors.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.scss$/, loader: 'scss-lint-loader', options: { config: '.scss-lint.yml', failOnError: true } } ] } };
scss-lint --version
Debug
Known issues
deprecatedscss-lint is deprecated; use stylelint instead. This loader will not work with scss-lint anymore.
fix
Migrate to stylelint-webpack-plugin with appropriate SCSS rules.
affects: >=1.0.0
gotchaThis loader expects scss-lint to be installed globally or in node_modules. If scss-lint is not found, it silently fails.
fix
Ensure scss-lint is installed: npm install -g scss-lint or npm install --save-dev scss-lint.
affects: >=1.0.0
breakingDoes not support Webpack 5 module federation or persistent caching. May cause build errors.
fix
Use stylelint-webpack-plugin or disable the loader.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'scss-lint'
scss-lint executable not installed or not in PATH.
fix
Install scss-lint: npm install -g scss-lint or npm install --save-dev scss-lint
Error: scss-lint configuration file not found
Default config file (.scss-lint.yml) missing.
fix
Create a .scss-lint.yml or specify config option in loader.
Error: Cannot find module './dist/loader'
Using the package incorrectly (direct require instead of loader).
fix
Use as a Webpack loader string, not a direct require.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
scss-lintrequiredscss-lint is the underlying linter executable required for this loader to work
Agent activity
2 hits · last 30 days
node
2
Resources
scss-lint-loader — npm install scss-lint-loader · libregistry