All Projects → hudochenkov → Stylelint Order

hudochenkov / Stylelint Order

Licence: mit
A plugin pack of order related linting rules for stylelint.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Stylelint Order

Magento2 Frontools
Set of front-end tools for Magento 2 based on Gulp.js
Stars: ✭ 416 (-31.47%)
Mutual labels:  stylelint, hacktoberfest
Vscode Stylelint
Official Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 141 (-76.77%)
Mutual labels:  stylelint, hacktoberfest
Homebrewery
Create authentic looking D&D homebrews using only markdown
Stars: ✭ 598 (-1.48%)
Mutual labels:  hacktoberfest
Node Cobol
📺 COBOL bridge for NodeJS which allows you to run COBOL code from NodeJS.
Stars: ✭ 606 (-0.16%)
Mutual labels:  hacktoberfest
Earthdata Search
Earthdata Search is a web application developed by NASA EOSDIS to enable data discovery, search, comparison, visualization, and access across EOSDIS' Earth Science data holdings.
Stars: ✭ 602 (-0.82%)
Mutual labels:  hacktoberfest
Graphite Web
A highly scalable real-time graphing system
Stars: ✭ 5,384 (+786.99%)
Mutual labels:  hacktoberfest
Images To Pdf
An app to convert images to PDF file!
Stars: ✭ 602 (-0.82%)
Mutual labels:  hacktoberfest
Yupe
Yupe! is an open source Yiiframework-based online e-commerce solution. Demo https://demo.yupe.ru/
Stars: ✭ 596 (-1.81%)
Mutual labels:  hacktoberfest
Octodash
OctoDash is a simple, but beautiful dashboard for OctoPrint.
Stars: ✭ 606 (-0.16%)
Mutual labels:  hacktoberfest
Materialdialog Android
📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily.
Stars: ✭ 602 (-0.82%)
Mutual labels:  hacktoberfest
Pdoc
🐍 ➡️ 📜 Auto-generate API documentation for Python projects
Stars: ✭ 604 (-0.49%)
Mutual labels:  hacktoberfest
Bookreader
The Internet Archive BookReader
Stars: ✭ 596 (-1.81%)
Mutual labels:  hacktoberfest
Core
Simple forum software for building great communities.
Stars: ✭ 5,372 (+785.01%)
Mutual labels:  hacktoberfest
Awesome Oneliner Bugbounty
A collection of awesome one-liner scripts especially for bug bounty tips.
Stars: ✭ 594 (-2.14%)
Mutual labels:  hacktoberfest
Cordova Js
Apache Cordova JavaScript Bridge
Stars: ✭ 598 (-1.48%)
Mutual labels:  hacktoberfest
Apiman
API Management
Stars: ✭ 606 (-0.16%)
Mutual labels:  hacktoberfest
Memento
Simple + Powerful interface to the Mnesia Distributed Database 💾
Stars: ✭ 597 (-1.65%)
Mutual labels:  hacktoberfest
Runtime
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
Stars: ✭ 7,742 (+1175.45%)
Mutual labels:  hacktoberfest
Challenges
PyBites Code Challenges
Stars: ✭ 604 (-0.49%)
Mutual labels:  hacktoberfest
Kiwi
the leading open source test management system
Stars: ✭ 607 (+0%)
Mutual labels:  hacktoberfest

stylelint-order

npm version npm downloads last month

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

Installation

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

Usage

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"
		]
	}
}

Rules

Autofixing

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 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": {
		"order/order": [
			[
				"custom-properties",
				"declarations"
			],
			{
				"disableFix": true
			}
		]
	}

Less may work but isn't officially supported.

Example configs

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

Thanks

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].