Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@benhigham/stylelint-config

benhigham23MIT0.3.0

My personal Stylelint configuration.

stylelint, stylelint-config, check, checker, code, codeguide, config, css, csslint, enforce, formatting, lint, linter, quality, standard, strict, style, styleguide, stylistic, validate, verify

readme

@benhigham/stylelint-config

npm version npm downloads License

My personal Stylelint configuration for maintaining consistent, high-quality CSS/SCSS code.

Features

This configuration:

  • Extends stylelint-config-standard-scss for SCSS support and best practices
  • Uses stylelint-config-recess-order for consistent property ordering
  • Enforces strict value usage for colors, font-sizes, and z-indices
  • Prevents performance issues with animations
  • Requires proper use of custom media queries and nesting
  • Enforces BEM naming conventions with SUIT CSS methodology
  • Ensures browser compatibility with Baseline requirements
  • Detects and prevents indistinguishable colors and out-of-gamut colors
  • Provides special handling for CSS modules

Installation

# npm
npm install --save-dev @benhigham/stylelint-config

# yarn
yarn add --dev @benhigham/stylelint-config

# pnpm
pnpm add --save-dev @benhigham/stylelint-config

Usage

Create a stylelint.config.js file in your project root and extend this configuration:

/** @type {import('stylelint').Config} */
export default {
  extends: ['@benhigham/stylelint-config'],
};

Configuration Details

Extended Configs

Plugins

This configuration includes several plugins:

Key Rules

  • Browser Compatibility: Enforces only widely supported CSS features
  • SCSS Best Practices: Limits nesting depth, enforces consistent naming patterns
  • BEM Pattern: Uses SUIT CSS methodology for class naming
  • CSS Modules: Special handling for .module.scss files with relaxed naming rules

License

This project is licensed under the MIT License.

changelog

@benhigham/stylelint-config

0.3.0

Minor Changes

  • 4f3d7f8 Thanks @benhigham! - Replace deprecated stylelint-plugin-require-baseline with stylelint-plugin-use-baseline

0.2.0

Minor Changes

0.1.1

Patch Changes

0.1.0

Minor Changes