Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylelint-order

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-order

A collection of order related linting rules for stylelint.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
decreased by-7.22%
Maintainers
1
Weekly downloads
 
Created

What is stylelint-order?

The stylelint-order npm package is a plugin for stylelint that provides order related linting rules for CSS properties within declaration blocks. It helps in enforcing a consistent order for CSS properties, which can make code easier to read and maintain.

What are stylelint-order's main functionalities?

Specifying the order of content within declaration blocks

This feature allows you to define the order in which different types of content within a declaration block should appear. For example, you can specify that custom properties should be declared before any other declarations.

{
  "plugins": [
    "stylelint-order"
  ],
  "rules": {
    "order/order": [
      "custom-properties",
      "declarations"
    ],
    "order/properties-order": [
      "position",
      "top",
      "right",
      "bottom",
      "left"
    ]
  }
}

Specifying the order of properties within declaration blocks

This feature allows you to define a specific order for CSS properties within a declaration block. You can list the properties in the order you want them to be linted. This can be a custom order or alphabetical order.

{
  "plugins": [
    "stylelint-order"
  ],
  "rules": {
    "order/properties-order": [
      "position",
      "z-index",
      "top",
      "right",
      "bottom",
      "left"
    ],
    "order/properties-alphabetical-order": {}
  }
}

Grouping and separating properties

This feature allows you to group related properties together and enforce an empty line before the group or between groups. This can improve readability and organization of CSS rules.

{
  "plugins": [
    "stylelint-order"
  ],
  "rules": {
    "order/properties-order": [
      [
        "position",
        "z-index"
      ],
      {
        "emptyLineBefore": "always",
        "properties": [
          "color",
          "font-size",
          "font-weight"
        ]
      }
    ]
  }
}

Other packages similar to stylelint-order

Keywords

FAQs

Package last updated on 28 Nov 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc