scsslint-hot-loader

1.0.10 • Public • Published

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

Documentation: using loaders

Within your webpack configuration, you'll need to add the scsslint-loader to the list of modules:

module.exports = {
  // ...
  module: {
    preloaders: [
      {
          test: /\.scss$/,
          loader: "scsslint-hot",
          exclude: /node_modules/
      }
    ]
  }
  // ...
}

Optional query parameters:

module.exports = {
  // ...
  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:

  1. Configuration file specified via the --config flag
  2. Configuration from .scss-lint.yml in the current working directory, if it exists
  3. Configuration from .scss-lint.yml in the user's home directory, if it exists

Package Sidebar

Install

npm i scsslint-hot-loader

Weekly Downloads

0

Version

1.0.10

License

MIT

Last publish

Collaborators

  • theblackbolt