A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/hudochenkov/stylelint-order below:

hudochenkov/stylelint-order: A plugin pack of order related linting rules for Stylelint.

A plugin pack of order-related linting rules for Stylelint. Every rule supports autofixing (stylelint --fix).

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

Add stylelint-order to your Stylelint config plugins array, then add rules you need to the rules list. All rules from stylelint-order need to be namespaced with order.

{
	"plugins": [
		"stylelint-order"
	],
	"rules": {
		"order/order": [
			"custom-properties",
			"declarations"
		],
		"order/properties-order": [
			"width",
			"height"
		]
	}
}

Every rule supports autofixing with stylelint --fix. postcss-sorting is used internally for order autofixing.

Automatic sorting has some limitations that are described for every rule, if any. Please, take a look at how comments are handled by postcss-sorting.

CSS-in-JS styles with template interpolation could be ignored by autofixing to avoid style corruption.

Autofixing in Less syntax may work but isn't officially supported.

All these configs have properties-order configured with logical properties groups:

properties-order and properties-alphabetical-order code and README were based on the declaration-block-properties-order rule which was a core rule prior to Stylelint 8.0.0.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4