2.0.1 • Published 8 years ago
@timkelty/neutrino-middleware-stylelint v2.0.1
Neutrino stylelint Middleware
@timkelty/neutrino-middleware-stylelint is Neutrino middleware for linting styles using stylelint.
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-stylelintnpm
❯ npm install --save @timkelty/neutrino-middleware-stylelintUsage
@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 tostylelint-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.