Registry / devops / stylelint-custom-processor-loader

stylelint-custom-processor-loader

JSON →
library0.6.0jsnpmunverified

A Webpack loader (v0.6.0) that integrates Stylelint with custom processors (e.g., styled-components, markdown, HTML) into the Webpack build pipeline. Unlike postcss-loader, which only handles CSS files, this loader enables linting of CSS-in-JS and other non-standard syntaxes directly from JavaScript/TypeScript files. It requires peer dependencies stylelint >=7.8 and webpack >=2, and is intended for Webpack 2+ only. The loader is stable but receives infrequent updates, designed specifically for custom processor workflows that postcss-loader cannot support.

npm install stylelint-custom-processor-loader
INSTALL
IMPORT
SIG · STYLELINT-CUSTOM-P
S
stylelint-custom-processor-loader
devopsjavascriptv0.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import stylelintCustomProcessorLoader from 'stylelint-custom-processor-loader'
const loader = require('stylelint-custom-processor-loader')
Loader is typically used in webpack config as string 'stylelint-custom-processor-loader', not imported directly. Node require works for runtime use, but ESM import is preferred for consistency.
default (config use)
module.exports = { module: { rules: [ { test: /\.jsx?$/, loader: 'stylelint-custom-processor-loader', exclude: /node_modules/ } ] } }
module.exports = { module: { rules: [ { test: /\.jsx?$/, use: 'stylelint-custom-processor-loader' } ] } }
Loader must come last (first executed) in the use array when combined with other loaders. Omitting 'exclude: /node_modules/' may cause errors. Common mistake: placing loader first in 'use' array.
options
import stylelintCustomProcessorLoader from 'stylelint-custom-processor-loader'; // In webpack config: { loader: 'stylelint-custom-processor-loader', options: { configPath: './.my-stylelintrc' } }
require('stylelint-custom-processor-loader').default
Options are passed via webpack's 'options' object, not imported. The npm package exports a single function, but direct import for options is not needed.

Shows webpack config integrating babel-loader and stylelint-custom-processor-loader, plus minimal .stylelintrc for styled-components.

// webpack.config.js const path = require('path'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, module: { rules: [ { test: /\.jsx?$/, use: ['babel-loader', 'stylelint-custom-processor-loader'], exclude: /node_modules/, }, ], }, }; // .stylelintrc (in project root) { "processors": ["stylelint-processor-styled-components"], "rules": { "declaration-colon-space-after": "always" } }
Debug
Known issues
breakingWebpack 1 is not supported; only Webpack 2+
fix
Upgrade to webpack >=2 or use stylelint-loader instead.
affects: >=0.0.0
gotchaLoader order: must be the last loader in the 'use' array (executed first). Placing it before babel-loader causes syntax errors.
fix
Ensure stylelint-custom-processor-loader is the last entry in the 'use' array (after other loaders).
affects: >=0.0.0
gotchaWithout stylelint config file or processors, linting does nothing.
fix
Create a .stylelintrc file and specify processors (e.g., stylelint-processor-styled-components).
affects: >=0.0.0
deprecatedLoader is no longer actively maintained; author recommends postcss-loader for standard CSS.
fix
For non-custom-processor workflows, switch to postcss-loader with stylelint plugin.
affects: >=0.6.0
breakingRequires Node >=6; incompatible with older Node versions.
fix
Upgrade Node to version >=6 or pin to an older version of the loader if needed.
affects: >=0.6.0
Errors
Common errors & fixes
Error: Cannot find module 'stylelint'
Missing peer dependency stylelint.
fix
Run: npm install --save-dev stylelint
Module build failed: Error: No configuration provided for stylelint-custom-processor-loader
Missing .stylelintrc or configPath option pointing to invalid config.
fix
Create a .stylelintrc file in project root or pass configPath option with valid path.
Error: Cannot find module 'stylelint-processor-styled-components'
Processor not installed or not specified in stylelint config.
fix
Install processor: npm install --save-dev stylelint-processor-styled-components, and add processors array to .stylelintrc.
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
Loader order incorrect (babel-loader runs after this loader on non-JS output).
fix
Ensure stylelint-custom-processor-loader is the last loader in the 'use' array (first executed).
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
stylelintrequiredPeer dependency: core linting engine required at runtime
webpackrequiredPeer dependency: loader interface required; webpack >=2
Agent activity
10 hits · last 30 days
node
8
Resources
stylelint-custom-processor-loader — npm install stylelint-custom-processor-loader · libregistry