Registry / testing / happiness-scss

happiness-scss

JSON →
library5.3.0jsnpmunverified

A SCSS/Sass linter based on sass-lint that enforces a 'happiness' style guide, similar to the JavaScript happiness linter. Current stable version is 5.3.0 (last released in 2017). It provides a CLI tool and Node.js API to check .scss and .sass files for style errors. Key differentiators: it is a simple, opinionated linter with minimal configuration, intended to bring consistency without debate. However, the project is no longer maintained, and sass-lint itself is deprecated in favor of stylelint. Use in legacy projects only.

npm install happiness-scss
INSTALL
IMPORT
SIG · HAPPINESS-SCSS
H
happiness-scss
testingjavascriptv5.3.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.

happiness-scss
import happiness from 'happiness-scss'
var happiness = require('happiness-scss')
Package supports both CommonJS and ES modules, but sass-lint deprecation makes new projects prefer stylelint instead.
Linter
import { Linter } from 'happiness-scss'
import Linter from 'happiness-scss'
Named export for the Linter class. The default export is the main function.
CLI
import { CLI } from 'happiness-scss'
CLI export is available for programmatic use of the command-line interface.

Shows CLI usage and Node.js API for linting SCSS/Sass files using happiness-scss.

// Install: npm install -g happiness-scss // Check all .scss files in current directory and subdirectories: happiness-scss // Or specify a glob pattern: happiness-scss "./src/**/*.scss" // Use different formatter: happiness-scss -f table // Ignore patterns: happiness-scss -i "./test/vendor/**" // Node.js API: const happiness = require('happiness-scss'); happiness.lintFiles('./src/**/*.scss', { formatter: 'stylish', options: { 'merge-default-rules': false } }).then(results => { console.log(results); });
happiness-scss --version
Debug
Known issues
deprecatedhappiness-scss is no longer maintained. Use stylelint instead.
fix
Migrate to stylelint with stylelint-config-standard-scss.
affects: >=0.0.0
deprecatedsass-lint is deprecated. happiness-scss wraps sass-lint and thus inherits its deprecation.
fix
Switch to stylelint and stylelint-scss plugin.
affects: >=0.0.0
gotchaThe CLI does not respect .sass-lint.yml configuration by default; it uses its own built-in rules.
fix
Use '--config' flag to specify custom config file if needed.
affects: >=0.0.0
gotchaIgnore pattern defaults to ./node_modules/** but does not ignore other common directories like .git, bower_components.
fix
Explicitly add ignore patterns for other directories using -i option.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'sass-lint'
sass-lint dependency missing or not installed.
fix
Run 'npm install sass-lint' as a dependency.
happiness-scss: command not found
happiness-scss not installed globally or not in PATH.
fix
Install globally: 'npm install -g happiness-scss' or use npx: 'npx happiness-scss'.
TypeError: happiness.lintFiles is not a function
Using wrong import/require or older version without that API.
fix
Use 'const happiness = require('happiness-scss');' and call happiness.lintFiles() from v5+.
Upgrade
Version history
5.3.0latest on npm
Audit
Dependencies
sass-lintrequiredhappiness-scss wraps sass-lint for actual linting logic
Agent activity
10 hits · last 30 days
node
10
Resources
happiness-scss — npm install happiness-scss · libregistry