npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@contactlab/stylelint-config

v2.0.0

Published

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

Downloads

15

Readme

@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