New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@contactlab/stylelint-config

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contactlab/stylelint-config

Contactlab Stylelint modular configuration - inspired by @giotramu/stylelint-config

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
3
Weekly downloads
 
Created
Source

@contactlab/stylelint-config

Build Status

Contactlab Stylelint extensible and sharable configuration.

Inspired by @giotramu/stylelint-config package.

It supports CSS or PostCSS syntax and CSS-in-JS solutions, like Styled Components, Emotion.js or Linaria.

Warning! This package needs Stylelint v15 (or higher) which has deprecated some rules, removed Nodejs v12 support and made Prettier integration smoother.

Usage

Install the configuration as a npm package:

npm i -D @contactlab/stylelint-config

# --- OR ---

yarn add -D @contactlab/stylelint-config

and then add it as extension in your Stylelint configuration file:

{
  "extends": ["@contactlab/stylelint-config"]
}

In order to have support for CSS-in-JS tools, use the styled config as extension:

{
  "extends": ["@contactlab/stylelint-config/styled"]
}

CSS properties order

Stylelint Config sorts the CSS property declarations by grouping them in the following order:

  1. Positioning
  2. Box Model
  3. Typography
  4. Visual
  5. Animation
  6. Misc

Extend the configuration

You can extend the configuration or overrides some rules. More details about the loading mechanism are available in the Stylelint documentation.

{
  "extends": "@contactlab/stylelint-config",
  "rules": {
    "selector-id-pattern": null,
    "selector-class-pattern": null
  }
}

Integrating Stylelint with IDEs/editors

Visual Studio Code

  1. install the Stylelint plugin;

  2. add the following code to your .vscode/settings.json:

    {
      "css.validate": false,
      "scss.validate": false,
      "editor.codeActionsOnSave": {
        "source.fixAll.stylelint": true
      },
      "stylelint.validate": ["css"] // Add the type of file you want to validate (e.g. ["css", "scss", "typescript", "typescriptreact"])
    }
    
  3. highlight the CSS-in-JS syntax with the Styled Components plugin (optional)

References

Keywords

FAQs

Package last updated on 04 Jan 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

  • 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