Socket
Socket
Sign inDemoInstall

stylelint-config-recommended

Package Overview
Dependencies
165
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stylelint-config-recommended

Recommended shareable config for Stylelint


Version published
Weekly downloads
3.5M
decreased by-2.53%
Maintainers
4
Install size
5.27 kB
Created
Weekly downloads
 

Package description

What is stylelint-config-recommended?

The stylelint-config-recommended package is a shareable configuration for Stylelint, a popular CSS linter. It provides a set of recommended rules to help you enforce consistent and error-free CSS code. This package includes a basic set of rules that catch common errors and enforce best practices.

What are stylelint-config-recommended's main functionalities?

Basic Configuration

This feature allows you to extend the recommended configuration in your Stylelint configuration file. By doing so, you inherit a set of predefined rules that help maintain code quality and consistency.

{
  "extends": "stylelint-config-recommended"
}

Catching Syntax Errors

This feature includes rules that catch common syntax errors such as empty blocks and invalid hex colors. These rules help prevent mistakes that could lead to broken or inconsistent styles.

{
  "rules": {
    "block-no-empty": true,
    "color-no-invalid-hex": true
  }
}

Enforcing Best Practices

This feature enforces best practices by including rules that prevent duplicate properties and font family names. These rules help ensure that your CSS is clean and maintainable.

{
  "rules": {
    "declaration-block-no-duplicate-properties": true,
    "font-family-no-duplicate-names": true
  }
}

Other packages similar to stylelint-config-recommended

Changelog

Source

8.0.0

  • Removed: stylelint less than 14.8.0 from peer dependencies.
  • Added: keyframe-block-no-duplicate-selectors rule.

Readme

Source

NPM version Build Status

The recommended shareable config for Stylelint.

It turns on all the Stylelint rules that help you avoid errors.

Use it as is or as a foundation for your own config.

Installation

npm install stylelint-config-recommended --save-dev

Usage

Set your stylelint config to:

{
  "extends": "stylelint-config-recommended"
}

Extending the config

Add a "rules" key to your config, then add your overrides and additions there.

For example, to change the at-rule-no-unknown rule to use its ignoreAtRules option, turn off the block-no-empty rule, and add the unit-allowed-list rule:

{
  "extends": "stylelint-config-recommended",
  "rules": {
    "at-rule-no-unknown": [
      true,
      {
        "ignoreAtRules": ["extends"]
      }
    ],
    "block-no-empty": null,
    "unit-allowed-list": ["em", "rem", "s"]
  }
}

Changelog

License

Keywords

FAQs

Last updated on 08 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc