Socket
Book a DemoInstallSign in
Socket

eslint-plugin-grouped-css-declarations

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-grouped-css-declarations

- Requires ESLint `>=8`

1.2.1
latest
npmnpm
Version published
Weekly downloads
33
-86.85%
Maintainers
0
Weekly downloads
 
Created
Source

ESLint Plugin Grouped CSS Declarations

Identifies @linaria/core CSS-in-JS tags and ensures that a standardised grouping of declarations is enforced using the PostCSS parser.

A group is identified as a logical set of declarations separated by either an empty line or a comment.

Issues will, whereever possible, be reported inline at violating CSS lines to allow developers to easily digest issues. However, in some cases such reports have not been implemented.

In practice the reports exist simply to improve DX-experience. The actual auto-fix relies upon comparing the original AST with an AST that fully respects the configured ordering, prioritised as follows:

  • Declaration grouping will be considered in scopes. AtRule and Rule creates new scopes.
  • The root scope will be positioned before other scopes. Then Rule scopes will follow and finally AtRules.
  • Inside each scope declarations will be sorted based on the provided grouping.
  • In case a group of declarations begins with a comment, then these will be taken out of the ordering flow and positioned at the end of the scope. Ordering will not be performed for this group.
  • If a declaration does not match any provided grouping then it will be added to a final group after all other groups. Inside declarations will be sorted alphabetically.

Installation

  • Requires ESLint >=8
yarn add --dev eslint-plugin-grouped-css-declarations
npm install --save-dev eslint-plugin-grouped-css-declarations

Usage

To include the recommended eslint-plugin-grouped-css-declarations to your ruleset add the following to your .eslintrc configuration:

{
  "extends": [
    "plugin:grouped-css-declarations/recommended"
  ]
}

Keywords

eslint

FAQs

Package last updated on 28 Oct 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.