Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Derivation of stylelint-order to make clockwise exception to properties-alphabetical-order

License

Notifications You must be signed in to change notification settings

magratheaguide/stylelint-alphabetical-clockwise-order

 
 

Repository files navigation

stylelint-alphabetical-clockwise-order

A derivation and fork of stylelint-order. Provides one rule, properties-alphabetical-clockwise-order, which sorts all properties alphabetically except long-form properties containing -top, -right, -bottom, or -left, which are sorted in that order.

Autofixing is still enabled, but still corrects to strictly alphabetical ordering. (TODO: #1 Update autofix to handle alpha-clockwise)

Installation

  1. If you haven't, install stylelint:
npm install stylelint --save-dev
  1. Install stylelint-alphabetical-clockwise-order:
npm install stylelint-alphabetical-clockwise-order --save-dev

Usage

Add stylelint-alphabetical-clockwise-order to your stylelint config plugins array, then add the plugin/properties-alphabetical-clockwise-order rule to the rules list (note the namespace).

{
	"plugins": [
		"stylelint-alphabetical-clockwise-order"
	],
	"rules": {
		"plugin/properties-alphabetical-clockwise-order": true
	}
}

Rules

Autofixing

Autofixing is enabled by default if it's enabled in stylelint's configuration file. It can be disabled on a per rule basis using the secondary option disableFix: true. Here's an example:

	"rules": {
		"plugin/alphabetical-clockwise-order": [
			true,
			{
				"disableFix": true
			}
		]
	}

Less may work but isn't officially supported.

About

Derivation of stylelint-order to make clockwise exception to properties-alphabetical-order

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 100.0%