Registry / devops / gulp-csscomb

gulp-csscomb

JSON →
library3.1.0jsnpmunverified

Gulp plugin for CSScomb, a CSS coding style formatter that automatically sorts and formats CSS properties according to a configurable style guide. Version 3.1.0 (latest) runs on Node >= 0.9.0. It integrates CSScomb into Gulp build pipelines, supporting custom config files (.csscomb.json) and predefined presets like 'zen'. Differentiated by being a direct wrapper around the standalone CSScomb.js library, it is lightweight and has no external dependencies beyond CSScomb itself. However, the project has been in maintenance mode since 2018, with CSScomb.js itself deprecated in favor of stylelint.

npm install gulp-csscomb
INSTALL
IMPORT
SIG · GULP-CSSCOMB
G
gulp-csscomb
devopsjavascriptv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

gulp-csscomb
import csscomb from 'gulp-csscomb';
var csscomb = require('gulp-csscomb');
Since v4.0.0 the package is ESM-only, but this version (3.1.0) supports CommonJS. For latest, use ESM syntax.
csscomb
const csscomb = require('gulp-csscomb');
import csscomb from 'gulp-csscomb'; // Works only if your project is ESM
CommonJS require is the standard for this legacy package. ESM import may work if the consuming project is ESM, but the package itself is CJS.
default export
const csscomb = require('gulp-csscomb'); csscomb()
const { csscomb } = require('gulp-csscomb');
The package exports a single function directly, not as a named export. Destructuring will result in undefined.

Shows how to use gulp-csscomb with a predefined preset ('zen') to format CSS files in a Gulp task.

const gulp = require('gulp'); const csscomb = require('gulp-csscomb'); gulp.task('comb', () => { return gulp.src('src/**/*.css') .pipe(csscomb('zen')) .pipe(gulp.dest('dist')); });
Debug
Known issues
deprecatedCSScomb is deprecated in favor of stylelint. This plugin is in maintenance mode and will not receive new features.
fix
Migrate to stylelint with stylelint-config-standard or similar.
affects: *
breakingVersion 4.0.0 drops Node.js support for versions < 14 and switches to ESM-only. If you are on an older Node or CJS, stick with v3.x.
fix
If on Node >=14 and using ESM, update to v4; otherwise stay on v3 and pin to 3.1.0.
affects: >=4.0.0
gotchaIf a .csscomb.json file is present in the same folder as the source files or project root, it overrides the preset argument. This can be surprising if you pass a preset but have a config file.
fix
Ensure no .csscomb.json exists if you intend to use a preset, or rename/remove it.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'gulp-csscomb'
Package not installed or missing from node_modules.
fix
Run 'npm install gulp-csscomb --save-dev'.
TypeError: csscomb is not a function
Incorrect import: try to destructure as { csscomb } or misunderstanding of the export style.
fix
Use 'const csscomb = require('gulp-csscomb');' (CommonJS) or 'import csscomb from 'gulp-csscomb';' (ESM) correctly.
gulp-csscomb: Options must be a string or object.
Passed an array, number, or other invalid type to csscomb().
fix
Pass either a string (preset name) or an options object (e.g., csscomb({...})).
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
csscombrequiredCore CSScomb library that does the actual CSS formatting
Agent activity
6 hits · last 30 days
node
6
Resources
gulp-csscomb — npm install gulp-csscomb · libregistry