• Stars
    star
    162
  • Rank 231,199 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A clean and complete config for stylelint-order.

Logo

stylelint-config-clean-order

npm test

Order your styles with stylelint-order.

Before After   
before after

Usage

Install stylelint and this package to your project:

npm install stylelint stylelint-config-clean-order --save-dev

Configure your stylelint configuration file (.stylelintrc.json) to extend this package:

⚠️ You don't need to install stylelint-order nor add stylelint-order to "plugins" since this package already does that for you.

{
  "extends": ["stylelint-config-clean-order"]
}

Severity Options

Default severity level is warning but you can use error variant to change severity level to error.

{
  "extends": ["stylelint-config-clean-order/error"]
}

Customization

You can import raw property groups to add or override rule options. Please refer to stylelint-order plugin documentation.

For example, you can override 'properties-order' rule to not have empty lines between groups:

const { propertyGroups } = require('stylelint-config-clean-order')

const propertiesOrder = propertyGroups.map((properties) => ({
  noEmptyLineBetween: true,
  emptyLineBefore: 'never', // Don't add empty lines between order groups.
  properties
}))

module.exports = {
  extends: ['stylelint-config-clean-order'],
  rules: {
    'order/properties-order': [
      propertiesOrder,
      {
        severity: 'warning',
        unspecified: 'bottomAlphabetical',
      }
    ]
  }
}

Extra empty lines for formatting

In addition to stylelint-order plugin, this package also overrides two rules (declaration-empty-line-before and at-rule-empty-line-before) to improve the final formatted result by adding extra empty lines between declarations. stylelint-config-clean-order does not override a rule other than these two.

If you want these rules to put into effect, make sure config packages after stylelint-config-clean-order do not override them.

About orders

I try to hand-pick style orders in the most logical way to improve process of CSS refactoring; for example font-size before line-height, display before align-items. If you think order of a rule doesn't make sense, please open an issue so we can discuss. Thanks!

License

MIT

More Repositories

1

dotfiles

My dotfiles: Experimental, ongoing configuration files, development environment and scripts for various Unix-like systems, text-based command-line applications and interfaces.
Lua
341
star
2

zsh-system-clipboard

System clipboard key bindings for Zsh Line Editor with vi mode. It is similar to what `set clipboard=unnamed` does for vim.
Shell
136
star
3

qrscan-pwa

A simple QR code scanner as a progressive web application, works offline, no ads, no trackers, written in Preact and TypeScript.
TypeScript
12
star
4

homebridge-cosa

Homebridge plugin for Cosa Smart Thermostat.
TypeScript
7
star
5

vim-fetlang

Vim runtime files for Fetlang, the fetish-themed programming language. Makes syntax highlighting possible for vim when writing fetlang files.
Vim Script
6
star
6

fast-syntax-highlighting

Contains the my latest local copy of zsh fast-syntax-highlighting plugin by @psprint. Not sure what happened to @zdharma organization, seems like it's deleted. So, this is just a temporary solution for my git submodules until it's hopefully up again.
Shell
5
star
7

telegram-rss-bot

Self-hosted solution to read your RSS feeds through your own Telegram channel.
TypeScript
4
star
8

reopen-cli

Improvement over `open` utility for macOS and Chrome; open URLs in the browser but instead of creating new tabs every time, use existing ones by mutating them.
JavaScript
4
star
9

config

Sharable configurations files for tools that I use; such as eslint, prettier, stylelint.
JavaScript
3
star
10

weather-me

Simple weather application that uses OpenWeatherMap API. I needed a fast app to simply search for cities and show their current weather conditions. So, it does simply one thing, show the current weather and its details.
TypeScript
3
star
11

kutsan.dev

Source-code of my personel website, written in Preact and TypeScript.
TypeScript
3
star
12

kutsan

Placeholder repository for myself and currently it does nothing useful.
JavaScript
2
star
13

add-idea-to-mysql

Simple web server to test Node.js MySQL module.
JavaScript
2
star
14

soyaendustriyel

React source-code of Soya Endüstriyel, an e-commerce entrepreneur as a professional cleaning products dealer.
TypeScript
2
star
15

chromium-blank-new-tab

Extremely simple and almost no-code blank new tab page extension for Chromium browsers.
HTML
2
star
16

smm-cli

User-friendly command-line interface for managing mountable local and remote devices with SSHFS. Optionally powered with your `~/.ssh/config/` file Host configurations.
Shell
2
star
17

chore-strike

Simple web app to manage basic home chores with its todo-list style panel.
TypeScript
1
star