Skip to content

Releases: hudochenkov/postcss-sorting

4.1.0

03 Mar 18:02
Compare
Choose a tag to compare
  • Added: Experimental support for HTML style tag and attribute (when used with postcss-html syntax).
  • Added: Experimental support for CSS-in-JS (when used with postcss-jsx syntax).

4.0.1

11 Nov 12:44
Compare
Choose a tag to compare
  • Fixed: Incorrect sorting in Node.js 11, due recent change to Array.sort() in V8.
  • Fixed: Logic for at-variables keyword for order now follows postcss-less@3 parser.

4.0.0

17 Jul 21:25
Compare
Choose a tag to compare
  • Breaking change: Dropped Node.js 4 support. Node.js 6.14.3 is the minimum supported version.
  • Could be a breaking change: Plugin won't sort inside some at-rule (mostly Sass specific directives). Read more about ignored at-rules.
  • Added: at-variables keyword for order.

3.1.0

30 Oct 11:22
Compare
Choose a tag to compare
  • Added: throw-validate-errors option.

3.0.2

24 Sep 20:57
Compare
Choose a tag to compare
  • Changed: Show more helpful error messages for invalid config.

3.0.1

08 Jul 22:41
Compare
Choose a tag to compare
  • Fixed: Inconsistent sorting for the same name properties in properties-order.

3.0.0. Cleanup

09 Jun 17:29
Compare
Choose a tag to compare

This is a cleanup release. Removed everything not related to ordering stylesheets. I recommend to use combination stylelint 7.11+ with --fix option and stylelint-order 0.5+ plugin instead of this plugin. Using combination above you'll receive linting and autofixing using only one tool!

  • Removed options:
    • at-rule-nested-empty-line-before
    • clean-empty-lines
    • comment-empty-line-before
    • custom-property-empty-line-before
    • declaration-empty-line-before
    • dollar-variable-empty-line-before
    • rule-nested-empty-line-before
  • Changes to properties-order:
    • Removed emptyLineBefore option.
    • Removed objects support in configuration. Use plain arrays instead.
  • Updated to PostCSS 6.

Migration from 2.x

Remove all *-empty-line-before and clean-empty-lines options. Use stylelint with --fix option instead.

properties-order doesn't support property groups. Convert it to a simple array. Use stylelint-order with --fix option for empty line before property groups.

Config for 2.x:

{
	"properties-order": [
		{
			"properties": [
				"margin",
				"padding"
			]
		},
		{
			"emptyLineBefore": true,
			"properties": [
				"border",
				"background"
			]
		}
	]
}

Config for 3.x:

{
	"properties-order": [
		"margin",
		"padding",
		"border",
		"background"
	]
}

2.1.0

25 May 10:18
Compare
Choose a tag to compare
  • Added: order supports new rule extended object, which has new selector option. Rules in order can be specified by their selector.
  • Fixed: Inconsistency with shared line comments.
  • Fixed: Incorrect behaviour if hasBlock was set to false in extended at-rule object in order.

2.0.1

12 Jan 11:18
Compare
Choose a tag to compare
  • Accept null for all options.

2.0.0

12 Jan 10:31
Compare
Choose a tag to compare

This release completely incompatible with the previous API. There is a lot new options. Please read the documentation.

A migration guide is available.

Added

  • sort-order split into order and properties-order.
  • Alphabetical order.
  • At-rules can be checked if they have a block. E.g., @include icon; has no block.
  • Custom properties and $-variables can be grouped separately.
  • Empty lines for different node types:
    • rule-nested-empty-line-before
    • at-rule-nested-empty-line-before
    • declaration-empty-line-before
    • custom-property-empty-line-before
    • dollar-variable-empty-line-before
    • comment-empty-line-before
  • clean-empty-lines: Remove all empty lines.

Changed

  • By default all options are disabled, and the plugin does nothing.
  • Empty lines don't delete anymore if only “order” options are enabled.
  • Dropped support for Node <4.

Removed

  • Predefined configs.
  • Command comments /* postcss-sorting: on/off */
  • preserve-empty-lines-between-children-rules
  • empty-lines-between-children-rules
  • empty-lines-between-media-rules
  • empty-lines-before-comment
  • empty-lines-after-comment