2.0.1 • Published 6 years ago

@timkelty/neutrino-middleware-stylelint v2.0.1

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
6 years ago

Neutrino stylelint Middleware

@timkelty/neutrino-middleware-stylelint is Neutrino middleware for linting styles using stylelint.

NPM version NPM downloads Join the Neutrino community on Spectrum

Requirements

  • Node.js v6.10+
  • Yarn or npm client
  • Neutrino v8

Installation

@timkelty/neutrino-middleware-stylelint can be installed via the Yarn or npm clients.

Yarn

❯ yarn add @timkelty/neutrino-middleware-stylelint

npm

❯ npm install --save @timkelty/neutrino-middleware-stylelint

Usage

@timkelty/neutrino-middleware-stylelint can be consumed from the Neutrino API, middleware, or presets. Require this package and plug it into Neutrino:

// Using function middleware format
const stylelint = require('@timkelty/neutrino-middleware-stylelint');

// Usage shows default values
neutrino.use(stylelint, {
  pluginId: 'stylelint',
  plugin: {
    files: '**/*.+(css|scss|sass|less)',
    context: neutrino.options.source,
    failOnError: neutrino.options.command !== 'start'
  }
});
  • stylelint: An stylelint configuration object.
    • Use this to configure rules, plugins, and other stylelint options.
    • This option is not set by default, causing stylelint to search for a config file.
  • plugin: Options passed to stylelint-webpack-plugin. See the stylelint Node API for all available options.

Contributing

This middleware is part of the neutrino-dev repository, a monorepo containing all resources for developing Neutrino and its core presets and middleware. Follow the contributing guide for details.