From 3cc837be17db9e99ee751f638654ef8a1d387de6 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 19 Dec 2023 16:58:24 +0000 Subject: [PATCH] Update Stylelint config to check property order --- .stylelintrc.json | 7 ++++++- package-lock.json | 25 ++++++++++++++++++++++++- package.json | 3 ++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index aae7653..16e3001 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,3 +1,8 @@ { - "extends": "stylelint-config-gds/scss" + "extends": "stylelint-config-gds/scss", + "ignoreFiles": ["_site/**/*.{css,scss}"], + "plugins": ["stylelint-order"], + "rules": { + "order/properties-alphabetical-order": true + } } diff --git a/package-lock.json b/package-lock.json index 85472c3..51731e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,8 @@ "rimraf": "^5.0.5", "rollup": "^4.4.0", "stylelint": "^15.0.0", - "stylelint-config-gds": "^1.0.0" + "stylelint-config-gds": "^1.0.0", + "stylelint-order": "^6.0.4" }, "engines": { "node": ">=18" @@ -10166,6 +10167,15 @@ "node": ">=4" } }, + "node_modules/postcss-sorting": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/postcss-sorting/-/postcss-sorting-8.0.2.tgz", + "integrity": "sha512-M9dkSrmU00t/jK7rF6BZSZauA5MAaBW4i5EnJXspMwt4iqTh/L9j6fgMnbElEOfyRyfLfVbIHj/R52zHzAPe1Q==", + "dev": true, + "peerDependencies": { + "postcss": "^8.4.20" + } + }, "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", @@ -12405,6 +12415,19 @@ } } }, + "node_modules/stylelint-order": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/stylelint-order/-/stylelint-order-6.0.4.tgz", + "integrity": "sha512-0UuKo4+s1hgQ/uAxlYU4h0o0HS4NiQDud0NAUNI0aa8FJdmYHA5ZZTFHiV5FpmE3071e9pZx5j0QpVJW5zOCUA==", + "dev": true, + "dependencies": { + "postcss": "^8.4.32", + "postcss-sorting": "^8.0.2" + }, + "peerDependencies": { + "stylelint": "^14.0.0 || ^15.0.0 || ^16.0.1" + } + }, "node_modules/stylelint-scss": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.3.2.tgz", diff --git a/package.json b/package.json index 1bb5bd1..b63916d 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ "rimraf": "^5.0.5", "rollup": "^4.4.0", "stylelint": "^15.0.0", - "stylelint-config-gds": "^1.0.0" + "stylelint-config-gds": "^1.0.0", + "stylelint-order": "^6.0.4" }, "optionalDependencies": { "govuk-prototype-kit": "^13.14.1"