scss-lint Webpack loader compatible with hot module replacement (HMR)
History
This package was motivated and spawned from 2 other linters that worked well in their own right: domjtalbot: scsslint-loader elijahmanor: scss-lint-loader
- One did not work with hot module replacement (HMR)
- The other had error reporting that cut short the error messages
Requirements
- Ruby 1.9.3+
- Sass 3.4.15+
- scss-lint 0.48.0+
- Files you wish to lint must be written in SCSS (not Sass) syntax
Install
$ npm install scsslint-hot-loader
Usage
Within your webpack configuration, you'll need to add the scsslint-loader to the list of modules:
moduleexports = // ... module: preloaders: test: /\.scss$/ loader: "scsslint-hot" exclude: /node_modules/ // ...
Optional query parameters:
moduleexports = // ... module: preloaders: test: /\.scss$/ loader: "scsslint-hot" exclude: /node_modules/ query: config: '.scss-lint.yml' failOnError: false failOnWarning: false // ...
Configuration
Please see scss-lint configuration for configuration options.
scss-lint
loads configuration in the following order of precedence:
- Configuration file specified via the
--config
flag - Configuration from
.scss-lint.yml
in the current working directory, if it exists - Configuration from
.scss-lint.yml
in the user's home directory, if it exists